Tag: string length

Microsoft文档中的C#String.Length

Microsoft文档声明此代码将返回7个字符 Length属性返回此实例中Char对象的数量,而不是Unicode字符数。 string characters = “abc\u0000def”; Console.WriteLine(characters.Length); // Displays 7 我将需要一个函数来返回结果12,因为有12个不同的字符。 我可以使用哪种function?