public final class TextUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
charToString(char ch) |
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 |
isNewLine(Glyph glyph) |
static boolean |
isNonPrintable(int c) |
static boolean |
isSpace(Glyph glyph) |
static boolean |
isSpaceOrWhitespace(Glyph glyph) |
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).
|
static boolean |
isUni0020(Glyph g) |
static boolean |
isWhitespace(Glyph glyph) |
static boolean |
isWhitespaceOrNonPrintable(int code) |
public static boolean isSurrogateHigh(char c)
c
- the character
public static boolean isSurrogateLow(char c)
c
- the character
public static boolean isSurrogatePair(String text, int idx)
text
- the String with the high and low surrogate characters
idx
- the index of the 'high' character in the pair
public static boolean isSurrogatePair(char[] text, int idx)
text
- the character array with the high and low surrogate characters
idx
- the index of the 'high' character in the pair
public static int convertToUtf32(char highSurrogate, char lowSurrogate)
highSurrogate
- the high surrogate value
lowSurrogate
- the low surrogate value
public static int convertToUtf32(char[] text, int idx)
text
- a character array that has the unicode character(s)
idx
- the index of the 'high' character
public static int convertToUtf32(String text, int idx)
text
- a String that has the unicode character(s)
idx
- the index of the 'high' character
public static int[] convertToUtf32(String text)
public static char[] convertFromUtf32(int codePoint)
codePoint
- a Unicode value
public static String convertFromUtf32(int[] text, int startPos, int endPos)
text
- a Unicode text sequence
startPos
- start position of text to convert, inclusive
endPos
- end position of txt to convert, exclusive
public static char[] convertFromUtf32ToCharArray(int codePoint)
codePoint
- a Unicode value
public static String charToString(char ch)
public static boolean isNewLine(Glyph glyph)
public static boolean isSpaceOrWhitespace(Glyph glyph)
public static boolean isWhitespace(Glyph glyph)
public static boolean isSpace(Glyph glyph)
public static boolean isUni0020(Glyph g)
public static boolean isNonPrintable(int c)
public static boolean isWhitespaceOrNonPrintable(int code)
Copyright © 1998–2017 iText Group NV. All rights reserved.