By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

How do I recognize space characters in keyboard input?

P: n/a

I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve

Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve

Nov 17 '05 #2

P: n/a
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve

Nov 17 '05 #3

P: n/a

thanks, I knew it had to be something simple.

Steve
On Tue, 21 Jun 2005 05:09:09 GMT, Rodger Constandse <ro*************@effexis.com> wrote:
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve


Nov 17 '05 #4

P: n/a

thanks, I knew it had to be something simple.

Steve
On Tue, 21 Jun 2005 05:09:09 GMT, Rodger Constandse <ro*************@effexis.com> wrote:
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve


Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.