How to identify whether first two characters of alphanumeric string are alphabet. If yes trim these two characters


#1

Hello I am extracting String value from excel. ex- “EF3452432”, “3232323”, “873264723” , “TF234324”

I want to first identify whether first two characters are alphabets or not. If yes trim that and if not do not trim.


#2

Since it’s a string array, run for each loop and use the below regex to check your condition using Regex.Match

/^[A-Za-z]{2}/

If found then to remove use

strValue.Substring(2)