Gets the length (in chars) of the Unicode character at the specified offset in the given string.
public static int GetCharacterLength(string value, int index)
parameter | description |
---|---|
value | A String. |
index | The character position in value. |
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 stringBuilder, int index)
parameter | description |
---|---|
stringBuilder | A StringBuilder. |
index | The character position in stringBuilder. |
The number of chars (i.e., UTF-16 code units) it takes to encode the character.