Extract only right most n letters from a string

Shyju picture Shyju · Nov 12, 2009 · Viewed 283.6k times · Source

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?

Answer

Vilx- picture Vilx- · Nov 12, 2009
string SubString = MyString.Substring(MyString.Length-6);