Package app.babylon.text
Class Strings
java.lang.Object
app.babylon.text.Strings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intindexOf(CharSequence s, char c) static intindexOf(CharSequence s, int start, int length, char c) static intindexOfAny(CharSequence s, char c1, char c2) static intindexOfAny(CharSequence s, char c1, char c2, char c3) static intindexOfAny(CharSequence s, char c1, char c2, char c3, char c4) static intindexOfAny(CharSequence s, int start, int length, char c1, char c2) static intindexOfAny(CharSequence s, int start, int length, char c1, char c2, char c3) static intindexOfAny(CharSequence s, int start, int length, char c1, char c2, char c3, char c4) static booleanisAlpha(char c) static booleanisAlphaNumeric(char c) static booleanstatic booleanstatic booleanisInt(CharSequence s, int start, int length) static booleanstatic booleanisLong(CharSequence s, int start, int length) static booleanisStripxEmpty(CharSequence s, int start, int length) static booleanstatic booleanisWholeNumber(CharSequence s, int start, int length) static intlastIndexOf(CharSequence s, char c) static intlastIndexOf(CharSequence s, int start, int length, char c) static CharSequenceleftPad(CharSequence s, int size, char padChar) static CharSequencestatic CharSequenceremoveDiacritics(CharSequence s, int start, int length) static CharSequencerightPad(CharSequence s, int size, char padChar) static CharSequenceUnicode-aware edge stripping equivalent toString.strip()forCharSequence.static intstripEnd(CharSequence s, int start, int length) Returns the exclusive end index of the trimmed slice after Unicode whitespace stripping.static intstripStart(CharSequence s, int start, int length) Returns the inclusive start index of the trimmed slice after Unicode whitespace stripping.static CharSequenceUnicode-aware edge stripping (likeString.strip()) plus additional ingestion cleanup characters.static CharSequencestripx(CharSequence s, int start, int length) static CharSequence
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
toCamelUpperPreserve
-
leftPad
-
rightPad
-
isAlpha
public static boolean isAlpha(char c) -
isAlphaNumeric
public static boolean isAlphaNumeric(char c) -
isEmpty
-
isStripxEmpty
-
indexOf
-
indexOf
-
indexOfAny
-
indexOfAny
-
indexOfAny
-
indexOfAny
-
indexOfAny
-
indexOfAny
public static int indexOfAny(CharSequence s, int start, int length, char c1, char c2, char c3, char c4) -
lastIndexOf
-
lastIndexOf
-
isWholeNumber
-
isWholeNumber
-
isInt
-
isInt
-
isLong
-
isLong
-
strip
Unicode-aware edge stripping equivalent toString.strip()forCharSequence. -
stripStart
Returns the inclusive start index of the trimmed slice after Unicode whitespace stripping.This is intended for slice-oriented parsing code that wants trimmed bounds without first creating a
CharSequence.subSequence(int, int)view. Paired withstripEnd(CharSequence, int, int), callers can decide whether a slice changed and only materialize a subsequence if the downstream parser requires one.Typical usage:
int strippedOffset = Strings.stripStart(s, offset, length); int strippedEnd = Strings.stripEnd(s, offset, length); if (strippedOffset < strippedEnd) { CharSequence candidate = s.subSequence(strippedOffset, strippedEnd); }This is generally preferable to a hypothetical
strip(CharSequence, int, int)helper for low-level parsing, because it lets the caller keep control of whether a new view object is created. -
stripEnd
Returns the exclusive end index of the trimmed slice after Unicode whitespace stripping.The returned value follows the normal Java
start/endconvention used byCharSequence.subSequence(int, int)andString.substring(int, int):- start is inclusive
- end is exclusive
- See Also:
-
stripx
Unicode-aware edge stripping (likeString.strip()) plus additional ingestion cleanup characters. -
stripx
-
removeDiacritics
-
removeDiacritics
-