C# String.Length from Microsoft Documentation -
microsoft documentation states code return 7 characters
the length property returns number of char objects in instance, not number of unicode characters.
string characters = "abc\u0000def"; console.writeline(characters.length); // displays 7 i need function return result 12 because there 12 different characters. function may use?
you have prevent interpretation of literal compiler. can done @ prefix, this:
var characters = @"abc\u0000def"; the length property of string return 12, there no longer actual unicode character in string.
Comments
Post a Comment