Hi,
If we have string values, how to find whether it is containing alphabets or numbers.
Thanks and Regards,
Hi,
If we have string values, how to find whether it is containing alphabets or numbers.
Thanks and Regards,
If it is a character then you can use
Char.IsLetter(c) or Char.IsDigit(c)
if it is a word or sentence you can use regular expression.
It may contain single alphabet or word.
just a few options and samples:
with regex
Use the “Is Match” activity with the following regular expressions to check for alphabets and numbers:
[a-zA-Z]
Input: The string you want to check Result: The “Is Match” activity will return True
if the string contains any alphabets.[0-9]
Input: The string you want to check Result: The “Is Match” activity will return True
if the string contains any numbers.Thanks!!
I am not fond of using Regexes for such small checks, it feels overkillish.
I prefer using Any() to check if ANY of the characters is a letter/number.
To search numbers, change “Char.IsLetter()” to “Char.IsDigit()”.
Feel free to change myString’s value to test the code samples.
VB
IsLetterCheck.xaml (6.9 KB)
C#
IsLetterCheck.xaml (8.0 KB)