Method to Check if String Contains anything other than Alphabets, Numbers, Special Characters

Hi All
I have a string, and I want to check if the string contain anything other than the English Alphabets, Numbers, and Special Characters
.
Basically, my string sometimes can contains any other language apart from English, if that is the case, I need to ignore a set of code.
eg: Address : "“福建省泉州市南安市水头镇东南小区1栋11”
So here above, If I can find it does not contain English alphabets, (other language) I need to ignore this even If it contains Numbers.

Please suggest.

Thanks in Advance.

1 Like

you can go through this post!

1 Like

Will it detect only mentioned languages or all.
As I will need to detect any thing other than English?

@Heena_Saini I guess you can use this expression as an alternative :

System.Text.RegularExpressions.Regex.IsMatch(yourString,"^[a-zA-Z]+$")

It will return True Or False

2 Likes

what about special characters, because it is English alphabets, using above regex, if the string contains special characters, it will return False.

@Heena_Saini Yes, You will have to include all the special characters in the regex as well :sweat_smile:

StringCheck.xaml (6.9 KB)

Test with your possible inputs…! @Heena_Saini

Thanks!

if the string is “1 Town Street A/ PPM Tower, 1 Adam Street”, in this case it will return false.

Hi @Heena_Saini,

Updated the workflow,

StringCheck.xaml (6.9 KB)

Tested working fine…Please have a look…!

Thanks!

2 Likes

yes this works. Thank You

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.