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

5 lines
166 B
C#
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
// 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]);