Class StringUtil
java.lang.Object
com.vividsolutions.jump.util.StringUtil
Useful String-related utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblankStringList(int size) Returns a List of empty Strings.static Stringcapitalize(String word) static StringclassNameWithoutPackageQualifiers(String className) static StringclassNameWithoutQualifiers(String className) static StringfillString(int len, char ch) static StringConverts the comma-delimited string into a List of trimmed strings.static Stringstatic Stringies(int n) Warning: hinders internationalizationstatic Stringstatic booleanstatic booleanstatic StringlimitLength(String s, int maxLength) static Stringrepeat(char c, int n) static voidreplace(StringBuffer orig, String o, String n, boolean all) Replaces all instances of the String o with the String n in the StringBuffer orig if all is true, or only the first instance if all is false.static StringReturns original with occurrences of oldSubstring replaced by newSubstring.static StringreplaceAll(String original, String oldSubstring, String newSubstring) Returns original with all occurrences of oldSubstring replaced by newSubstringstatic Strings(int n) Warning: hinders internationalizationstatic StringLine-wraps s by inserting a newline instead of the first space after the nth column.static StringReturns an throwable's stack tracestatic Stringsubstitute(String string, Object[] substitutions) static StringReturns the elements of c separated by commas.static StringtoDelimitedString(Collection<?> c, String delimiter) static StringtoFriendlyName(String className) static StringtoFriendlyName(String className, String substringToRemove) static StringtoString(double d) format Doubles to a String representation, cutting zeroes from the decimal end the minimum number of decimals is one, hinting the decimal nature of this number the maximimum number of decimal is hardcoded 12 and will be rounded eg. 1234.000 -> "1234.0", 1234.5600 -> "1234.56"static StringtoTimeString(long milliseconds) static Stringuncapitalize(String word)
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
s
Warning: hinders internationalization -
ies
Warning: hinders internationalization -
substitute
-
classNameWithoutQualifiers
-
classNameWithoutPackageQualifiers
-
repeat
-
split
-
capitalize
-
uncapitalize
-
fromCommaDelimitedString
-
blankStringList
-
toFriendlyName
-
friendlyName
-
toFriendlyName
-
insertSpaces
-
toCommaDelimitedString
Returns the elements of c separated by commas. If c is empty, an empty String will be returned.- Parameters:
c- a Collection of objects to convert to Strings and delimit by commas- Returns:
- a String containing c's elements, delimited by commas
-
replaceAll
-
replace
-
replace
Replaces all instances of the String o with the String n in the StringBuffer orig if all is true, or only the first instance if all is false. Posted by Steve Chapel invalid input: '<'schapel@breakthr.com> on UseNet -
stackTrace
-
head
-
limitLength
-
isNumber
-
toDelimitedString
-
toTimeString
-
isEmpty
-
fillString
-
toString
format Doubles to a String representation, cutting zeroes from the decimal end the minimum number of decimals is one, hinting the decimal nature of this number the maximimum number of decimal is hardcoded 12 and will be rounded eg. 1234.000 -> "1234.0", 1234.5600 -> "1234.56"- Parameters:
d- double value to format- Returns:
- a formatted (rounded) string representation of the double
-