How can I extract a substring which is composed of the rightmost six letters from another string?
Ex: my string is "PER 343573". Now I want to extract only "343573".
How can I do this?
How can I extract a substring which is composed of the rightmost six letters from another string?
Ex: my string is "PER 343573". Now I want to extract only "343573".
How can I do this?
MSDN
EDIT: too slow...
Null Safe Methods :
Strings shorter than the max length returning the original string
String Right Extension Method
String Left Extension Method
Just a thought:
Guessing at your requirements but the following regular expression will yield only on 6 alphanumerics before the end of the string and no match otherwise.
Probably nicer to use an extension method:
Usage