Search code examples
c#stringsubstring

Extract only right most n letters from a string


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?


Solution

  • string SubString = MyString.Substring(MyString.Length-6);