Sunday, September 29, 2013

Splitting number and string using linq

Does this work for you?




string s = string.Concat( NameComp.TakeWhile( c => !char.IsDigit( c ) ) );
string d = string.Concat( NameComp.Skip( s.Length ) );
// or
string d = NameComp.Substring( s.Length );













No comments:

Post a Comment