Logo

Programming-Idioms

History of Idiom 169 > diff from v52 to v53

Edit summary for version 53 by programming-idioms.org:
[Csharp] +DemoURL

Version 52

2019-01-06, 03:32:01

Version 53

2019-01-06, 10:12:49

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Illustration

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Illustration
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Code
int n = s.Length;
Code
int n = s.Length;
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.string.length?view=netframework-4.7.2
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.string.length?view=netframework-4.7.2
Demo URL
https://dotnetfiddle.net/LP2kxC