public final class TextUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static char[] |
convertFromUtf32(int codePoint)
Converts a UTF32 code point value to a String with the corresponding character(s).
|
static String |
convertFromUtf32(int[] text,
int startPos,
int endPos)
/**
Converts a UTF32 code point sequence to a String with the corresponding character(s).
|
static char[] |
convertFromUtf32ToCharArray(int codePoint)
Converts a UTF32 code point value to a char array with the corresponding character(s).
|
static int |
convertToUtf32(char[] text,
int idx)
Converts a unicode character in a character array to a UTF 32 code point value.
|
static int |
convertToUtf32(char highSurrogate,
char lowSurrogate)
Returns the code point of a UTF32 character corresponding with
a high and a low surrogate value.
|
static int[] |
convertToUtf32(String text) |
static int |
convertToUtf32(String text,
int idx)
Converts a unicode character in a String to a UTF32 code point value
|
static boolean |
isSurrogateHigh(char c)
Check if the value of a character belongs to a certain interval
that indicates it's the higher part of a surrogate pair.
|
static boolean |
isSurrogateLow(char c)
Check if the value of a character belongs to a certain interval
that indicates it's the lower part of a surrogate pair.
|
static boolean |
isSurrogatePair(char[] text,
int idx)
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).
|
static boolean |
isSurrogatePair(String text,
int idx)
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 boolean isSurrogateHigh(char c)
c - the characterpublic static boolean isSurrogateLow(char c)
c - the characterpublic static boolean isSurrogatePair(String text, int idx)
text - the String with the high and low surrogate charactersidx - the index of the 'high' character in the pairpublic static boolean isSurrogatePair(char[] text,
int idx)
text - the character array with the high and low surrogate charactersidx - the index of the 'high' character in the pairpublic static int convertToUtf32(char highSurrogate,
char lowSurrogate)
highSurrogate - the high surrogate valuelowSurrogate - the low surrogate valuepublic static int convertToUtf32(char[] text,
int idx)
text - a character array that has the unicode character(s)idx - the index of the 'high' characterpublic static int convertToUtf32(String text, int idx)
text - a String that has the unicode character(s)idx - the index of the 'high' characterpublic static int[] convertToUtf32(String text)
public static char[] convertFromUtf32(int codePoint)
codePoint - a Unicode valuepublic static String convertFromUtf32(int[] text, int startPos, int endPos)
text - a Unicode text sequencestartPos - start position of text to convert, inclusiveendPos - end position of txt to convert, exclusivepublic static char[] convertFromUtf32ToCharArray(int codePoint)
codePoint - a Unicode valueCopyright © 1998–2016 iText Group NV. All rights reserved.