Package com.webfirmframework.wffweb.lang
Class UnicodeString
java.lang.Object
com.webfirmframework.wffweb.lang.UnicodeString
An immutable class for unicode based string manipulation.
- Since:
- 3.0.15
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]
boolean
boolean
int
hashCode()
int
indexOf
(int c) int
indexOf
(UnicodeString uc) boolean
isBlank()
int
lastIndexOf
(int c) int
int
length()
replace
(UnicodeString forString, UnicodeString with) split
(int delim) splitByAny
(int[] delims) boolean
strip()
substring
(int startIndex) substring
(int startIndex, int endIndex)
-
Constructor Details
-
UnicodeString
-
UnicodeString
public UnicodeString(int[] codePoints)
-
-
Method Details
-
length
public int length()- Returns:
- the number of unicode chars contained in it or -1 if it is a null UnicodeString.
-
codePoints
public int[] codePoints() -
newString
-
hashCode
public int hashCode() -
equals
-
isBlank
public boolean isBlank()- Returns:
- true if it contains only whitespace otherwise false.
- Since:
- 3.0.15
-
substring
- Parameters:
startIndex
-endIndex
- exclusive- Returns:
- the substring
-
substring
- Parameters:
startIndex
-- Returns:
- the substring
-
indexOf
- Parameters:
uc
- the UnicodeString- Returns:
- the index
- Since:
- 3.0.15
-
indexOf
public int indexOf(int c) - Parameters:
c
- the unicode char code- Returns:
- the index
- Since:
- 3.0.15
-
lastIndexOf
- Parameters:
uc
- the UnicodeString- Returns:
- the index from last
- Since:
- 3.0.15
-
lastIndexOf
public int lastIndexOf(int c) - Parameters:
c
- c the unicode char code- Returns:
- the index from last
- Since:
- 3.0.15
-
replace
- Parameters:
forString
- the string for which the replacement to be done.with
- the matching to be replaced with this value.- Returns:
- the processed string
- Since:
- 3.0.15
-
replace
- Parameters:
forString
- the string for which the replacement to be done.with
- the matching to be replaced with this value.- Returns:
- the processed string
- Since:
- 3.0.15
-
startsWith
- Parameters:
us
-- Returns:
- true if this UnicodeString starts with the given UnicodeString.
- Since:
- 3.0.15
-
endsWith
- Parameters:
us
-- Returns:
- true if this UnicodeString ends with the given UnicodeString.
- Since:
- 3.0.15
-
strip
- Returns:
- the stripped UnicodeString
- Since:
- 3.0.15
-
split
- Parameters:
delim
- to by which the given string to be split. It is the code point value of char.- Returns:
- the array of UnicodeStrings split by the given unicode char code.
- Since:
- 3.0.15
-
splitByAny
- Parameters:
delims
- to by which the given string to be split. It is the code point values of chars, i.e. unicode values.- Returns:
- the array of UnicodeStrings split by the given chars.
- Since:
- 3.0.15
-