Package org.scijava.util
Class StringUtils
- java.lang.Object
-
- org.scijava.util.StringUtils
-
-
Field Summary
Fields Modifier and Type Field Description static charDEFAULT_PAD_CHAR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisNullOrEmpty(String s)static StringpadEnd(String s, int length)CallspadEnd(String, int, char)with theDEFAULT_PAD_CHARstatic StringpadEnd(String s, int length, char padChar)Adds characters to the end of theStringto make it the given lengthstatic StringpadStart(String s, int length)CallspadStart(String, int, char)with theDEFAULT_PAD_CHARstatic StringpadStart(String s, int length, char padChar)Adds characters to the start of theStringto make it the given lengthstatic booleansamePrefix(String s1, String s2)Checks if two filenames have the same prefix.static Stringsanitize(String s)Removes unprintable characters from the given string.static StringsanitizeDouble(String value)Normalizes the decimal separator for the user's locale.static String[]splitUnquoted(String s, String separator)Splits a string only at separators outside of quotation marks (").static StringstripNulls(String toStrip)Removes null bytes from a string.
-
-
-
Field Detail
-
DEFAULT_PAD_CHAR
public static final char DEFAULT_PAD_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
splitUnquoted
public static String[] splitUnquoted(String s, String separator)
Splits a string only at separators outside of quotation marks ("). Does not handle escaped quotes.
-
sanitizeDouble
public static String sanitizeDouble(String value)
Normalizes the decimal separator for the user's locale.
-
samePrefix
public static boolean samePrefix(String s1, String s2)
Checks if two filenames have the same prefix.
-
sanitize
public static String sanitize(String s)
Removes unprintable characters from the given string.
-
isNullOrEmpty
public static boolean isNullOrEmpty(String s)
-
padEnd
public static String padEnd(String s, int length)
CallspadEnd(String, int, char)with theDEFAULT_PAD_CHAR
-
padEnd
public static String padEnd(String s, int length, char padChar)
Adds characters to the end of theStringto make it the given length- Parameters:
s- the original stringlength- the length of the string with paddingpadChar- the character added to the end- Returns:
- the end padded
String. Null if s is null, s if no padding is not necessary
-
padStart
public static String padStart(String s, int length)
CallspadStart(String, int, char)with theDEFAULT_PAD_CHAR
-
padStart
public static String padStart(String s, int length, char padChar)
Adds characters to the start of theStringto make it the given length- Parameters:
s- the original stringlength- the length of the string with paddingpadChar- the character added to the start- Returns:
- the start padded
String. Null if s is null, s if no padding is not necessary
-
-