C# FAQ: How get the rightmost part of a string
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:FAQs |
| edit |
[edit]
How get the rightmost part of a string?
Actually, there are many ways to obtain the rightmost characters from a string. One method is to use the String.Substring method. Where string1 is a string of n or more characters in length, fetch the last n characters in this way:
string string2 = string1.Substring (string1.Length-n);
[edit]