How to split the string

hi,
string s = “EMA123_33”; // I need “EMA”
string s = “EMADRR123_33”; // I need “EMADRR”

Hi @skrishna,

Use Regular expression to get the data.

System.Text.RegularExpressions.Regex.Replace("EMADRR123_33","([^A-Za-z]+)",string.Empty)

Regards,
Arivu

1 Like

Thank you