public final class TextUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
countLeadingWhitespaces(CharSequence cs,
int offset,
int length)
Returns the number of leading whitespace characters in the given character sequence range.
|
static int |
countTrailingWhitespaces(CharSequence cs,
int offset,
int length)
Returns the number of trailing whitespace characters in the given character sequence range.
|
static byte |
parseByte(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a
byte value. |
static BigDecimal |
parseDecimal(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a decimal value.
|
static double |
parseDouble(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a
double value. |
static float |
parseFloat(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a
float value. |
static int |
parseInt(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a
int value. |
static long |
parseLong(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a
long value. |
static short |
parseShort(CharSequence cs,
int offset,
int length)
Parses a character sequence which may represent a
short value. |
static String |
quote(CharSequence cs)
Quotes the given string as Java string literal style, and returns it.
|
static void |
quoteTo(CharSequence cs,
StringBuilder target)
Quotes the given string as Java string literal style, and puts it into the given buffer.
|
public static String quote(CharSequence cs)
cs
- the source stringpublic static void quoteTo(CharSequence cs, StringBuilder target)
cs
- the source stringtarget
- the destination bufferpublic static int countLeadingWhitespaces(CharSequence cs, int offset, int length)
cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthpublic static int countTrailingWhitespaces(CharSequence cs, int offset, int length)
cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthpublic static byte parseByte(CharSequence cs, int offset, int length)
byte
value.cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongpublic static short parseShort(CharSequence cs, int offset, int length)
short
value.cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongpublic static int parseInt(CharSequence cs, int offset, int length)
int
value.cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongpublic static long parseLong(CharSequence cs, int offset, int length)
long
value.cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongpublic static BigDecimal parseDecimal(CharSequence cs, int offset, int length)
cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongpublic static float parseFloat(CharSequence cs, int offset, int length)
float
value.cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongpublic static double parseDouble(CharSequence cs, int offset, int length)
double
value.cs
- the target character sequenceoffset
- the character (the number of 16-bit char
) offset in the target sequencelength
- the character (the number of 16-bit char
) lengthIllegalArgumentException
- if the character sequence is wrongCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.