Skip to main content

Good article on getting the right characters of a string in C#

Left, Right, SubString C#


 https://kodify.net/csharp/strings/left-right-mid/#left-right-and-mid-string-segments-in-c


FeatureDescription C# equivalent
Left Get specific number of characters (count) from left part string.Substring(0, count)
RightGet specific number of characters (count) from right sidestring.Substring(string.Length
- count, count)
MidGet a specific number of characters (count) starting at a certain point (index)string.Substring(index, count)
MidGet all characters starting at a certain point (index)string.Substring(index)


Comments