S
skneife
Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Sam
bool result = IsDigit(string s);
Sam
Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Sam
Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Use a regular expression. Something simple like "[0-9]+" should work.Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Chris.
Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Sam
Very good suggestion !Use a regular expression. Something simple like "[0-9]+" should work.
<mode="pedant">[email protected] said:Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Use a regular expression. Something simple like "[0-9]+" should work.
Chris.
rossum said:<mode="pedant">
That does not work for all languages using non-Roman alphabets. For
example Arabic (?????), Unicode U+0660 on, or devanagari (?????),
Unicode U+0966 on, have their own sets of digits. The question is not
specified sufficiently clearly to determine if your answer is
sufficient or not.
</mode>
Chris Shepherd said:LOL@<mode="pedant" />, but I hardly call that being pedantic. It's very
true, if the OP is parsing non-Arabic numbering, it will be an issue.
Chris.
I am not sure what you laughed about, but for me it was the non-valid
xml.
Peter Duniho said:How do you know it was supposed to be XML?
Maybe he's just using a markup that happens to be similar to XML, but
which has its own rules. For all you know, the markup he used could be
perfectly valid when interpreted correctly.
rossum said:<mode="pedant">Use a regular expression. Something simple like "[0-9]+" should work.Doeas any know the simplest way for create this type of function:
bool result = IsDigit(string s);
Chris.
That does not work for all languages using non-Roman alphabets. For
example Arabic (?????), Unicode U+0660 on, or devanagari (?????),
Unicode U+0966 on, have their own sets of digits. The question is not
specified sufficiently clearly to determine if your answer is
sufficient or not.
</mode>
rossum
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.