String ends with alphabet

Hi,
Suppose i have a string like
154589
5875-25KL
95689
2548-MK

Here i want to check whether the string ends with alphabet and if yes then i have to ignore them then how should i do.

Hi @Rup_1

Returns Boolean
Char.IsLetter(yourstring_lastletter)

Regards,
Karthik Byggari

Hi Karthik,
I used following code and i got result

Char.IsLetter(MyString(MyString.Length-1)

but i want to delete all alphabet upto the number i.e
suppose i have string 5875-25KL then result should be 5875-25 only
suppose i have string 5879-25MNHGT then result should be 5879-25 only
then how should i do.

Hi @Rup_1

You can use Regular expression for extracting only the number part.
Please use the following Regex expression to extract only the number part including hyphen (-).

string resultString = Regex.Match(“5875-25KL”, @"\d+-*\d+").Value

\d+ -> one or more digits
-* -> 0 or more hyphens
\d+ -> one or more digits

Regards,
Karthik Byggari

Use “is match” activity with pattern “.+\w”. This will give you Boolean value as result. If the string have pattern of any value “.+” end with an alphabet “\w”, then it will give result as true.