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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -