|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.lang.StringFunction
public final class StringFunction
A collection of useful string functions.
Method Summary | |
---|---|
static String |
chop(StringBuilder buffer) Chops off the last character of the buffer and returns the string value of the modified buffer. |
static boolean |
isLastChar(String string, char ch) Checks if the last character of the given string matches the given ch . |
static String |
strip(String string) Replaces all consecutive white spaces by one space and removes white spaces from the start and end of the string. |
static String |
toHyphenVersion(String camelCasedString) Returns the camelCasedString in a hyphen version. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String chop(StringBuilder buffer)
Removes the last character if the buffer has at least one character. Returns the value as passed in otherwise.
buffer
- the buffer to chop.
public static String toHyphenVersion(String camelCasedString)
camelCasedString
in a hyphen version.
Each upper case letter is replaces by a dash and the lower case letter.
thisIsACamleCaseExample -> this-is-a-camle-case-example
camelCasedString
- the input string.
null
if
null
is passed as an argument.
public static boolean isLastChar(String string, char ch)
ch
.
string
- the string to test.
ch
- the expected last character of
string
.
true
if
ch
matches the last character of
string
,
false
otherwise.
public static String strip(String string)
string
- the string to strip.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |