For:
var str = "hello world!";
To get the resulting string without the first 10 characters and an empty string if the string is less than or equal to a length of up to 10, you can use:
var result = str.Length <= 10 ? "" : str.Substring(10);
or
var result = str.Length <= 10 ? "" : str.Remove(0, 10);
The first option is preferable, since it needs only one parameter of the method.
Rฤzvan Flavius โโPanda Aug 25 2018-11-11T00: 00Z
source share