Yes, the array is 0-based so that the first word is flist[0], that is "This". If you access the length property of the string "This",
the Length property returns the number of Char objects in this instance,
not the number of Unicode characters. The reason is that a Unicode character might be represented by more than one Char. (From document,
https://docs.microsoft.com/en-us/dotnet/api/system.string.length?view=netcore-3.1#remarks)
As you said, T[0]h[1]i[2]s[4], it has four chars.
Best regards,
Sean
ASP.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
Contributor
3040 Points
897 Posts
Re: how to give the color of changable word character
Oct 28, 2020 09:54 AM|Sean Fang|LINK
Hi rahulpas,
Yes, the array is 0-based so that the first word is flist[0], that is "This". If you access the length property of the string "This", the Length property returns the number of Char objects in this instance, not the number of Unicode characters. The reason is that a Unicode character might be represented by more than one Char. (From document, https://docs.microsoft.com/en-us/dotnet/api/system.string.length?view=netcore-3.1#remarks)
As you said, T[0]h[1]i[2]s[4], it has four chars.
Best regards,
Sean