public class StringUtils extends Object
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
String |
firstCapitalLetter(String s)
For stings longer than 1, make the first letter capital
|
String |
formatInteger(int number,
int digits)
Format an integer in a string of n digits.
|
String |
formatNumbersWithSpaces(String number)
Format an integer passed as string to separate groups of three digits with spaces.
|
String |
formatNumberWithSeparator(String number,
String separator)
Format a number given as String using a separator.
|
boolean |
isInteger(String input)
Check if a string is an integer
|
boolean |
isOnlyCharacterString(String input)
Check if a string is a characters string
|
String |
onlyCharacterString(String source)
Remove special characters from a String
|
List<String> |
splitOnUpperCase(String source)
Split a string when an uppercase character is found.
|
String |
stripNonValidXMLCharacters(String in)
Remove non valid XML characters from a string
|
String |
trimLeft(String s)
Remove beginning whitespaces
|
String |
trimRight(String s)
Remove ending whitespaces
|
public String trimLeft(String s)
s
- the string to cleanpublic String trimRight(String s)
s
- the string to cleanpublic String onlyCharacterString(String source)
source
- the source string (title, author...)public boolean isInteger(String input)
input
- the string to checkpublic boolean isOnlyCharacterString(String input)
input
- the string to checkpublic String formatInteger(int number, int digits)
number
- the source integerdigits
- number of desired digits in the outputpublic String formatNumbersWithSpaces(String number)
number
- a source integer as stringpublic String firstCapitalLetter(String s)
s
- the source stringpublic String formatNumberWithSeparator(String number, String separator)
number
- the number given as a Stringseparator
- the separator to format the Stringpublic String stripNonValidXMLCharacters(String in)
in
- the input string encoding the XMLCopyright © 2016. All rights reserved.