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
Post a Comment