RosettaCodeData/Task/Substring/C-sharp/substring-2.cs

5 lines
166 B
C#

// B: starting from n characters in, up to the end of the string;
Console.WriteLine(s[n..]);
// C: whole string minus the last character;
Console.WriteLine(s[..^1]);