c# - how to find the word and split the integer and characters in a string -


please tell me question answer please ...

string ss="pradeep rao having 2years exp"; 

in above string want find word of years(or) year , if match the word,i wnt split word

string s="2"; string s1="years(or)year" 

thanks pradeep

easiest way regular expression so:

regex = new regex("(\d+)(years?)");  match match = regex.match(ss); if(match.success) {   string s = match.groups[1];   string s1 = match.groups[2]; } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -