Class TextUtil
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
Methods
CharCount(int)
public static int CharCount(int codePoint)
Parameters
codePoint
int
Returns
CharsetIsSupported(string)
public static bool CharsetIsSupported(string charset)
Parameters
charset
string
Returns
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
inta 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
intstart position of text to convert, inclusive
endPos
intend 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
inta 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
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
intthe 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
Returns
- int
the codepoint value
HighSurrogate(int)
public static char HighSurrogate(int codePoint)
Parameters
codePoint
int
Returns
IsCarriageReturnFollowedByLineFeed(GlyphLine, int)
public static bool IsCarriageReturnFollowedByLineFeed(GlyphLine glyphLine, int carriageReturnPosition)
Parameters
Returns
IsDiacritic(int)
Checks if the passed code point corresponds to diacritic.
public static bool IsDiacritic(int codePoint)
Parameters
codePoint
intthe 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
IsLetterOrDigit(Glyph)
public static bool IsLetterOrDigit(Glyph glyph)
Parameters
glyph
Glyph
Returns
IsMark(Glyph)
public static bool IsMark(Glyph glyph)
Parameters
glyph
Glyph
Returns
IsNewLine(char)
Determines if represented Glyph is '\n' or '\r' character.
public static bool IsNewLine(char c)
Parameters
c
char
Returns
IsNewLine(int)
Determines if represented Glyph is '\n' or '\r' character.
public static bool IsNewLine(int unicode)
Parameters
unicode
int
Returns
IsNewLine(Glyph)
Determines if represented Glyph is '\n' or '\r' character.
public static bool IsNewLine(Glyph glyph)
Parameters
glyph
Glyph
Returns
IsNonBreakingHyphen(Glyph)
public static bool IsNonBreakingHyphen(Glyph glyph)
Parameters
glyph
Glyph
Returns
IsNonPrintable(int)
public static bool IsNonPrintable(int c)
Parameters
c
int
Returns
IsSpaceOrWhitespace(Glyph)
Determines if represented Glyph is space or whitespace character.
public static bool IsSpaceOrWhitespace(Glyph glyph)
Parameters
glyph
Glyph
Returns
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
charthe 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
charthe 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
intthe 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
stringthe String with the high and low surrogate characters
idx
intthe 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
IsWhiteSpace(char)
public static bool IsWhiteSpace(char ch)
Parameters
ch
char
Returns
IsWhiteSpace(int)
public static bool IsWhiteSpace(int unicode)
Parameters
unicode
int
Returns
IsWhitespace(Glyph)
Determines if represented Glyph is whitespace character.
public static bool IsWhitespace(Glyph glyph)
Parameters
glyph
Glyph
Returns
IsWhitespaceOrNonPrintable(int)
public static bool IsWhitespaceOrNonPrintable(int code)
Parameters
code
int
Returns
LowSurrogate(int)
public static char LowSurrogate(int codePoint)
Parameters
codePoint
int
Returns
NewEncoder(Encoding)
public static Encoding NewEncoder(Encoding charset)
Parameters
charset
Encoding
Returns
ToChars(int)
public static char[] ToChars(int codePoint)
Parameters
codePoint
int
Returns
- char[]