UnicodeUtility.GetCharacterLength method (1 of 2)

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.

Return Value

The number of chars (i.e., UTF-16 code units) it takes to encode the character.

See Also


UnicodeUtility.GetCharacterLength method (2 of 2)

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.

Return Value

The number of chars (i.e., UTF-16 code units) it takes to encode the character.

See Also