Check if the last for characters in a string are numbers

Hello,
I would like to know about the last for characters in a string variable.
I would like to check if the last 4 characters are all numbers as my IF condition.
What condition or steps could I use?

InputString: 48RK4841 ; Output: True
InputString: 48RKE841 ; Output: False
InputString: 48RK484 ; Output False

The Output that was True was because the last for characters(4841) are all numbers.

Hi,

Can you try the following expression in the if condition?

System.Text.RegularExpressions.Regex.IsMatch(InputString,"\d{4}$")

Regards,

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