public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
checkFilePath(String path) |
static String |
defaultString(String str,
String defaultStr)
Returns either the passed in String, or if the String is
null , the value of defaultStr . |
static boolean |
isBlank(CharSequence cs)
Checks if a CharSequence is whitespace, empty ("") or null.
|
static boolean |
isValidOIDFormat(String oid) |
static String |
join(List<?> array,
String separator)
Joins the elements of the provided array into a single String
|
static String[] |
parseUserAgent(String ua)
Parses the input user-agent header and returns the browserType [0]
and browser version [1].
|
static String |
quoteJsonString(String src)
Quote a string for use in JSON.
|
static String |
removeCRLF(String text) |
static String |
replaceAll(List<?> params,
String msg,
String delim)
Replaces all occurrences of Delim+
|
static String |
replaceAll(String[] params,
String msg,
String delim) |
public static String[] parseUserAgent(String ua)
ua
- String HttpRequest header user-agentpublic static String replaceAll(List<?> params, String msg, String delim)
params
- ArrayList of replacementsmsg
- The String to manipulatedelim
- The deliminator used as the replacement flagpublic static String join(List<?> array, String separator)
array
- the array of values to join together, may be nullseparator
- the separator character to use, null treated as ""public static boolean isValidOIDFormat(String oid)
public static String quoteJsonString(String src)
src
- Source stringpublic static boolean isBlank(CharSequence cs)
Copyright © 2017 Nets Branch Norway. All Rights Reserved.