Gets the length (in chars) of the Unicode character at the specified offset in the given string.
public static int GetCharacterLength(string s, int nIndex)
parameter | description |
---|---|
s | A String. |
nIndex | The character position in s. |
The number of chars (i.e., UTF-16 code units) it takes to encode the character.
Gets the length (in chars) of the Unicode character at the specified offset in the given StringBuilder.
public static int GetCharacterLength(StringBuilder sb, int nIndex)
parameter | description |
---|---|
sb | A StringBuilder. |
nIndex | The character position in sb. |
The number of chars (i.e., UTF-16 code units) it takes to encode the character.