Table of Contents

Class TextUtil

Namespace
iText.IO.Util
Assembly
itext.io.dll

This file is a helper class for internal usage only.

public sealed class TextUtil
Inheritance
TextUtil
Inherited Members

Remarks

This file is a helper class for internal usage only. Be aware that its API and functionality may be changed in future.

Fields

CHARACTER_MIN_SUPPLEMENTARY_CODE_POINT

public const int CHARACTER_MIN_SUPPLEMENTARY_CODE_POINT = 65536

Field Value

int

Methods

CharCount(int)

public static int CharCount(int codePoint)

Parameters

codePoint int

Returns

int

CharsetIsSupported(string)

public static bool CharsetIsSupported(string charset)

Parameters

charset string

Returns

bool

ConvertFromUtf32(int)

Converts a UTF32 code point value to a char array with the corresponding character(s).

public static char[] ConvertFromUtf32(int codePoint)

Parameters

codePoint int

a Unicode value

Returns

char[]

the corresponding char array

ConvertFromUtf32(int[], int, int)

/ Converts a UTF32 code point sequence to a String with the corresponding character(s).

public static string ConvertFromUtf32(int[] text, int startPos, int endPos)

Parameters

text int[]

a Unicode text sequence

startPos int

start position of text to convert, inclusive

endPos int

end position of txt to convert, exclusive

Returns

string

the corresponding characters in a String

ConvertFromUtf32ToCharArray(int)

Converts a UTF32 code point value to a char array with the corresponding character(s).

public static char[] ConvertFromUtf32ToCharArray(int codePoint)

Parameters

codePoint int

a Unicode value

Returns

char[]

the corresponding characters in a char array

ConvertToUtf32(char, char)

Returns the code point of a UTF32 character corresponding with a high and a low surrogate value.

public static int ConvertToUtf32(char highSurrogate, char lowSurrogate)

Parameters

highSurrogate char

the high surrogate value

lowSurrogate char

the low surrogate value

Returns

int

a code point value

ConvertToUtf32(char[], int)

Converts a unicode character in a character array to a UTF 32 code point value.

public static int ConvertToUtf32(char[] text, int idx)

Parameters

text char[]

a character array that has the unicode character(s)

idx int

the index of the 'high' character

Returns

int

the code point value

ConvertToUtf32(string)

public static int[] ConvertToUtf32(string text)

Parameters

text string

Returns

int[]

ConvertToUtf32(string, int)

Converts a unicode character in a String to a UTF32 code point value

public static int ConvertToUtf32(string text, int idx)

Parameters

text string

a String that has the unicode character(s)

idx int

the index of the 'high' character

Returns

int

the codepoint value

HighSurrogate(int)

public static char HighSurrogate(int codePoint)

Parameters

codePoint int

Returns

char

IsCarriageReturnFollowedByLineFeed(GlyphLine, int)

public static bool IsCarriageReturnFollowedByLineFeed(GlyphLine glyphLine, int carriageReturnPosition)

Parameters

glyphLine GlyphLine
carriageReturnPosition int

Returns

bool

IsDiacritic(int)

Checks if the passed code point corresponds to diacritic.

public static bool IsDiacritic(int codePoint)

Parameters

codePoint int

the code point to check

Returns

bool

true if passed code point is diacritic, false otherwise

IsIdentifierIgnorable(int)

Determines if the specified character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

public static bool IsIdentifierIgnorable(int codePoint)

Parameters

codePoint int

Returns

bool

IsLetterOrDigit(Glyph)

public static bool IsLetterOrDigit(Glyph glyph)

Parameters

glyph Glyph

Returns

bool

IsMark(Glyph)

public static bool IsMark(Glyph glyph)

Parameters

glyph Glyph

Returns

bool

IsNewLine(char)

Determines if represented Glyph is '\n' or '\r' character.

public static bool IsNewLine(char c)

Parameters

c char

Returns

bool

IsNewLine(int)

Determines if represented Glyph is '\n' or '\r' character.

public static bool IsNewLine(int unicode)

Parameters

unicode int

Returns

bool

IsNewLine(Glyph)

Determines if represented Glyph is '\n' or '\r' character.

public static bool IsNewLine(Glyph glyph)

Parameters

glyph Glyph

Returns

bool

IsNonBreakingHyphen(Glyph)

public static bool IsNonBreakingHyphen(Glyph glyph)

Parameters

glyph Glyph

Returns

bool

IsNonPrintable(int)

public static bool IsNonPrintable(int c)

Parameters

c int

Returns

bool

IsSpaceOrWhitespace(Glyph)

Determines if represented Glyph is space or whitespace character.

public static bool IsSpaceOrWhitespace(Glyph glyph)

Parameters

glyph Glyph

Returns

bool

IsSurrogateHigh(char)

Check if the value of a character belongs to a certain interval that indicates it's the higher part of a surrogate pair.

public static bool IsSurrogateHigh(char c)

Parameters

c char

the character

Returns

bool

true if the character belongs to the interval

IsSurrogateLow(char)

Check if the value of a character belongs to a certain interval that indicates it's the lower part of a surrogate pair.

public static bool IsSurrogateLow(char c)

Parameters

c char

the character

Returns

bool

true if the character belongs to the interval

IsSurrogatePair(char[], int)

Checks if two subsequent characters in a character array are are the higher and the lower character in a surrogate pair (and therefore eligible for conversion to a UTF 32 character).

public static bool IsSurrogatePair(char[] text, int idx)

Parameters

text char[]

the character array with the high and low surrogate characters

idx int

the index of the 'high' character in the pair

Returns

bool

true if the characters are surrogate pairs

IsSurrogatePair(string, int)

Checks if two subsequent characters in a String are are the higher and the lower character in a surrogate pair (and therefore eligible for conversion to a UTF 32 character).

public static bool IsSurrogatePair(string text, int idx)

Parameters

text string

the String with the high and low surrogate characters

idx int

the index of the 'high' character in the pair

Returns

bool

true if the characters are surrogate pairs

IsUni0020(Glyph)

Determines if represented Glyph is ' ' (SPACE) character.

public static bool IsUni0020(Glyph g)

Parameters

g Glyph

Returns

bool

IsWhiteSpace(char)

public static bool IsWhiteSpace(char ch)

Parameters

ch char

Returns

bool

IsWhiteSpace(int)

public static bool IsWhiteSpace(int unicode)

Parameters

unicode int

Returns

bool

IsWhitespace(Glyph)

Determines if represented Glyph is whitespace character.

public static bool IsWhitespace(Glyph glyph)

Parameters

glyph Glyph

Returns

bool

IsWhitespaceOrNonPrintable(int)

public static bool IsWhitespaceOrNonPrintable(int code)

Parameters

code int

Returns

bool

LowSurrogate(int)

public static char LowSurrogate(int codePoint)

Parameters

codePoint int

Returns

char

NewEncoder(Encoding)

public static Encoding NewEncoder(Encoding charset)

Parameters

charset Encoding

Returns

Encoding

ToChars(int)

public static char[] ToChars(int codePoint)

Parameters

codePoint int

Returns

char[]