public final class TextUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
charsetIsSupported(String charsetName) |
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 char |
highSurrogate(int codePoint) |
static boolean |
isCarriageReturnFollowedByLineFeed(GlyphLine glyphLine,
int carriageReturnPosition) |
static boolean |
isNewLine(char c)
Check if a character is a newline by checking if it's integer value is a newline in unicode
|
static boolean |
isNewLine(Glyph glyph)
Check if a glyph is a newline by checking if it's unicode value is a newline
|
static boolean |
isNewLine(int unicode)
Check if a character is a newline by checking if it's integer value is a newline in unicode
|
static boolean |
isNonBreakingHyphen(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) |
static char |
lowSurrogate(int codePoint) |
public static boolean isSurrogateHigh(char c)
c - the characterpublic static boolean isSurrogateLow(char c)
c - the characterpublic static char highSurrogate(int codePoint)
public static char lowSurrogate(int codePoint)
public 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 valuepublic static String charToString(char ch)
public static boolean isNewLine(Glyph glyph)
glyph - glyph to checkpublic static boolean isNewLine(char c)
c - character to checkpublic static boolean isNewLine(int unicode)
unicode - unicode value to checkpublic static boolean isCarriageReturnFollowedByLineFeed(GlyphLine glyphLine, int carriageReturnPosition)
public static boolean isSpaceOrWhitespace(Glyph glyph)
public static boolean isWhitespace(Glyph glyph)
public static boolean isNonBreakingHyphen(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)
public static boolean charsetIsSupported(String charsetName)
Copyright © 1998–2019 iText Group NV. All rights reserved.