Logo

Programming-Idioms

History of Idiom 38 > diff from v52 to v53

Edit summary for version 53 by programming-idioms.org:
[C#] +DocURL

Version 52

2019-12-06, 02:29:38

Version 53

2019-12-08, 00:39:12

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration
Code
var t = s.Substring(i, j - i);
Code
var t = s.Substring(i, j - i);
Comments bubble
The first argument is the index of first character in substring. The second argument is the substring length.
Comments bubble
The first argument is the index of first character in substring. The second argument is the substring length.
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.string.substring?view=netframework-4.8#System_String_Substring_System_Int32_System_Int32_