public class HappyStringStatic
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Function<java.lang.Object,java.lang.String> |
asTitle |
Function<java.lang.Object,java.lang.String> |
capitalized |
EN |
EN |
Function<java.lang.Object,java.lang.String> |
escape |
Predicate<java.lang.Object> |
isWhitespace |
Function<java.lang.Object,java.lang.Integer> |
len |
Function<java.lang.Object,java.lang.String> |
lower |
Function<java.lang.Object,java.lang.String> |
strip |
Function<java.lang.Object,java.lang.String> |
stripAccents |
Function<java.lang.Object,java.lang.String> |
toLowerCase |
Function<java.lang.Object,java.lang.String> |
toUpperCase |
Function<java.lang.Object,java.lang.String> |
translit |
Function<java.lang.Object,java.lang.String> |
trim |
Function<java.lang.Object,java.lang.String> |
unidecode |
Function<java.lang.Object,java.lang.String> |
upper |
Constructor and Description |
---|
HappyStringStatic() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
capitalize(java.lang.String string) |
java.lang.String |
copyValueOf(char[] data)
Returns a String that represents the character sequence in the
array specified.
|
java.lang.String |
copyValueOf(char[] data,
int offset,
int count)
Returns a String that represents the character sequence in the
array specified.
|
static ParametrizedFunction<java.lang.Object,java.lang.Integer> |
count(char character) |
static ParametrizedFunction<java.lang.Object,java.lang.Integer> |
count(java.lang.String substring) |
java.lang.String |
escape(java.lang.String string) |
java.lang.String |
format(java.util.Locale l,
java.lang.String format,
java.lang.Object... args)
Returns a formatted string using the specified locale, format string,
and arguments.
|
java.lang.String |
format(java.lang.String format,
java.lang.Object... args)
Returns a formatted string using the specified format string and
arguments.
|
boolean |
isWhitespace(java.lang.String string)
Checks if the String contains only whitespace.
|
java.lang.String |
stripAccents(java.lang.String string) |
java.lang.String |
title(java.lang.String string) |
java.lang.String |
toLowerCase(java.lang.String string) |
java.lang.String |
translit(java.lang.String string) |
java.lang.String |
unidecode(java.lang.String string) |
java.lang.String |
valueOf(boolean b)
Returns the string representation of the
boolean argument. |
java.lang.String |
valueOf(char c)
Returns the string representation of the
char
argument. |
java.lang.String |
valueOf(char[] data)
Returns the string representation of the
char array
argument. |
java.lang.String |
valueOf(char[] data,
int offset,
int count)
Returns the string representation of a specific subarray of the
char array argument. |
java.lang.String |
valueOf(double d)
Returns the string representation of the
double argument. |
java.lang.String |
valueOf(float f)
Returns the string representation of the
float argument. |
java.lang.String |
valueOf(int i)
Returns the string representation of the
int argument. |
java.lang.String |
valueOf(long l)
Returns the string representation of the
long argument. |
java.lang.String |
valueOf(java.lang.Object obj)
Returns the string representation of the
Object argument. |
public Function<java.lang.Object,java.lang.String> stripAccents
public Function<java.lang.Object,java.lang.String> translit
public Function<java.lang.Object,java.lang.String> unidecode
public Function<java.lang.Object,java.lang.String> escape
public Function<java.lang.Object,java.lang.String> strip
public Function<java.lang.Object,java.lang.String> trim
public Function<java.lang.Object,java.lang.String> toLowerCase
public Function<java.lang.Object,java.lang.String> lower
public Function<java.lang.Object,java.lang.String> toUpperCase
public Function<java.lang.Object,java.lang.String> upper
public Function<java.lang.Object,java.lang.String> capitalized
public Function<java.lang.Object,java.lang.String> asTitle
public Function<java.lang.Object,java.lang.Integer> len
public EN EN
public Predicate<java.lang.Object> isWhitespace
public static ParametrizedFunction<java.lang.Object,java.lang.Integer> count(java.lang.String substring)
public static ParametrizedFunction<java.lang.Object,java.lang.Integer> count(char character)
public java.lang.String stripAccents(java.lang.String string)
public java.lang.String translit(java.lang.String string)
public java.lang.String unidecode(java.lang.String string)
public java.lang.String escape(java.lang.String string)
public java.lang.String toLowerCase(java.lang.String string)
public java.lang.String capitalize(java.lang.String string)
public java.lang.String title(java.lang.String string)
public boolean isWhitespace(java.lang.String string)
Checks if the String contains only whitespace.
null
will return false
.
An empty CharSequence (length()=0) will return true
.
StringUtils.isWhitespace(null) = false StringUtils.isWhitespace("") = true StringUtils.isWhitespace(" ") = true StringUtils.isWhitespace("abc") = false StringUtils.isWhitespace("ab2c") = false StringUtils.isWhitespace("ab-c") = false
string
- the String to check, may be nulltrue
if only contains whitespace, and is non-nullpublic java.lang.String format(java.lang.String format, java.lang.Object... args)
The locale always used is the one returned by Locale.getDefault()
.
format
- A format stringargs
- Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The number of arguments is
variable and may be zero. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
The Java™ Virtual Machine Specification.
The behaviour on a
null argument depends on the conversion.java.lang.NullPointerException
- If the format is nullFormatter
public java.lang.String format(java.util.Locale l, java.lang.String format, java.lang.Object... args)
l
- The locale to apply during
formatting. If l is null then no localization
is applied.format
- A format stringargs
- Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The number of arguments is
variable and may be zero. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
The Java™ Virtual Machine Specification.
The behaviour on a
null argument depends on the conversion.Formatter
public java.lang.String valueOf(java.lang.Object obj)
Object
argument.obj
- an Object
.null
, then a string equal to
"null"
; otherwise, the value of
obj.toString()
is returned.Object.toString()
public java.lang.String valueOf(char[] data)
char
array
argument. The contents of the character array are copied; subsequent
modification of the character array does not affect the newly
created string.data
- a char
array.public java.lang.String valueOf(char[] data, int offset, int count)
char
array argument.
The offset
argument is the index of the first
character of the subarray. The count
argument
specifies the length of the subarray. The contents of the subarray
are copied; subsequent modification of the character array does not
affect the newly created string.
data
- the character array.offset
- the initial offset into the value of the
String
.count
- the length of the value of the String
.java.lang.IndexOutOfBoundsException
- if offset
is
negative, or count
is negative, or
offset+count
is larger than
data.length
.public java.lang.String copyValueOf(char[] data, int offset, int count)
data
- the character array.offset
- initial offset of the subarray.count
- length of the subarray.String
that contains the characters of the
specified subarray of the character array.public java.lang.String copyValueOf(char[] data)
data
- the character array.String
that contains the characters of the
character array.public java.lang.String valueOf(boolean b)
boolean
argument.b
- a boolean
.true
, a string equal to
"true"
is returned; otherwise, a string equal to
"false"
is returned.public java.lang.String valueOf(char c)
char
argument.c
- a char
.1
containing
as its single character the argument c
.public java.lang.String valueOf(int i)
int
argument.
The representation is exactly the one returned by the
Integer.toString
method of one argument.
i
- an int
.int
argument.Integer.toString(int, int)
public java.lang.String valueOf(long l)
long
argument.
The representation is exactly the one returned by the
Long.toString
method of one argument.
l
- a long
.long
argument.Long.toString(long)
public java.lang.String valueOf(float f)
float
argument.
The representation is exactly the one returned by the
Float.toString
method of one argument.
f
- a float
.float
argument.Float.toString(float)
public java.lang.String valueOf(double d)
double
argument.
The representation is exactly the one returned by the
Double.toString
method of one argument.
d
- a double
.double
argument.Double.toString(double)