public class StringUtil extends Object
| Constructor and Description |
|---|
StringUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
cleanUpPathPrefix(String prefix)
Make sure the string starts with a forward slash but does not end with one; converts back-slashes to forward-slashes; if in String is null or empty, returns zero length string.
|
static String |
join(List<String> list,
String delim)
Deprecated.
Use
com.google.common.base.Joiner instead |
static String |
mapToStr(Map<?,?> map)
Creates an encoded String from a Map of name/value pairs (MUST BE STRINGS!)
|
static List<String> |
quoteStrList(List<String> list)
Encloses each of a List of Strings in quotes.
|
static String |
removeSpaces(String str)
Removes all spaces from a string
|
static String |
replaceString(String mainString,
String oldString,
String newString)
Replaces all occurances of oldString in mainString with newString
|
static List<String> |
split(String str,
String delim)
Splits a String on a delimiter into a List of Strings.
|
static Map<String,String> |
strToMap(String str)
Creates a Map from an encoded name/value pair string
|
public static String replaceString(String mainString, String oldString, String newString)
mainString - The original stringoldString - The string to replacenewString - The string to insert in place of the oldpublic static String join(List<String> list, String delim)
com.google.common.base.Joiner insteadlist - a list of strings to joindelim - the delimiter character(s) to use. (null value will join with no delimiter)public static List<String> split(String str, String delim)
str - the String to splitdelim - the delimiter character(s) to join on (null will split on whitespace)public static List<String> quoteStrList(List<String> list)
list - List of String(s) to quote.public static Map<String,String> strToMap(String str)
str - The string to decode and formatpublic static String mapToStr(Map<?,?> map)
map - The Map of name/value pairspublic static String cleanUpPathPrefix(String prefix)
Copyright © 2018 Atlassian. All rights reserved.