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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -