public class Strings
extends java.lang.Object
Constructor and Description |
---|
Strings() |
Modifier and Type | Method and Description |
---|---|
static int |
characterAt(java.lang.CharSequence cseq,
int index)
Get character (code point) at a offset.
|
static int |
characterAt(java.lang.CharSequence cseq,
int start,
int end,
int index)
Get character (code point) at a offset.
|
static int |
compareTo(java.lang.CharSequence str1,
java.lang.CharSequence str2) |
static void |
copyInto(java.lang.CharSequence src,
int start,
int end,
CharSeq dst,
int at) |
static java.lang.String |
fromUtf8(byte[] bytes,
int start,
int length) |
static int |
indexByCodePoints(java.lang.CharSequence str,
int index)
Get index'th character (code point).
|
static IString |
indirectIndexed(java.lang.CharSequence base,
IntSequence indexes)
Make a read-only substring, generalized to arbitrary index sequences.
|
static void |
makeCapitalize(CharSeq str)
Capitalize this string.
|
static void |
makeLowerCase(CharSeq str)
Change every character to be lowercase.
|
static void |
makeUpperCase(CharSeq str)
Change every character to be uppercase.
|
static int |
offsetByCodePoints(java.lang.CharSequence str,
int offset,
int cuStart,
int cpStart)
Like offsetByCodePoints, but optimize if an IString.
|
static void |
printJson(java.lang.CharSequence str,
java.lang.Appendable ps) |
static void |
printQuoted(java.lang.CharSequence str,
java.lang.Appendable ps,
int escapes)
Print a string with quotes and escapes.
|
static java.lang.String |
replicate(int from,
int to,
boolean suppliedTo,
java.lang.CharSequence string,
int start,
int end,
boolean suppliedEnd) |
static int |
sizeInCodePoints(java.lang.CharSequence str) |
static java.lang.CharSequence |
substring(java.lang.CharSequence base,
int start,
int end)
Make a read-only substring.
|
static java.lang.String |
toJson(java.lang.CharSequence str) |
static byte[] |
toUtf16(java.lang.CharSequence str,
int start,
int end,
boolean bigEndian,
boolean writeBOM) |
public static int characterAt(java.lang.CharSequence cseq, int index)
index
- offset measured in 16-bit code unitspublic static int characterAt(java.lang.CharSequence cseq, int start, int end, int index)
index
- offset measured in 16-bit code units,
from begining of cseq, not frm startpublic static int indexByCodePoints(java.lang.CharSequence str, int index)
index
- offset by code pointspublic static int offsetByCodePoints(java.lang.CharSequence str, int offset, int cuStart, int cpStart)
offset
- number of code points beyond start index.cuStart
- start index in code units (Java chars)cpStart
- start index in Unicode code pointspublic static int sizeInCodePoints(java.lang.CharSequence str)
public static void makeUpperCase(CharSeq str)
public static void makeLowerCase(CharSeq str)
public static void makeCapitalize(CharSeq str)
public static java.lang.String toJson(java.lang.CharSequence str)
public static void printJson(java.lang.CharSequence str, java.lang.Appendable ps)
public static void printQuoted(java.lang.CharSequence str, java.lang.Appendable ps, int escapes)
escapes
- The value 0 means only escape '"' and '\\';
the value 1 means escape standard escape characters like '\\b';
the value 2 means escape all non-ascii or control characters;
the value 3 means follow the JSON standard.public static void copyInto(java.lang.CharSequence src, int start, int end, CharSeq dst, int at)
public static IString indirectIndexed(java.lang.CharSequence base, IntSequence indexes)
public static java.lang.CharSequence substring(java.lang.CharSequence base, int start, int end)
public static java.lang.String fromUtf8(byte[] bytes, int start, int length)
public static byte[] toUtf16(java.lang.CharSequence str, int start, int end, boolean bigEndian, boolean writeBOM)
public static int compareTo(java.lang.CharSequence str1, java.lang.CharSequence str2)
public static java.lang.String replicate(int from, int to, boolean suppliedTo, java.lang.CharSequence string, int start, int end, boolean suppliedEnd)