How to remove first 10 characters from a string?

csharper picture csharper · Aug 25, 2011 · Viewed 235.3k times · Source

How to ignore the first 10 characters of a string?

Input:

str = "hello world!";

Output:

d!

Answer

crlanglois picture crlanglois · Aug 25, 2011

str = str.Remove(0,10); Removes the first 10 characters

or

str = str.Substring(10); Creates a substring starting at the 11th character to the end of the string.

For your purposes they should work identically.