public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
chomp(String theLine)
Removes any line separators (\r ot \n) from the end of a string and
returns that string
|
static String[] |
concatenate(String[] array1,
String[] array2) |
static int |
countLines(String theString)
Counts the number of lines in a string by counting the number of "\n" or
"\r" or "\r\n" sequences which appear in it
|
static boolean |
isBlank(String theString)
Returns
true if the string is null, or contains no non-whitespace characters |
static boolean |
isNotBlank(String theString)
Inverse of
isBlank(String) |
static String |
replace(String theString,
String theMatch,
String theReplacement)
Search within a string and replace one substring with another.
|
static void |
validateNotEmpty(String theValue)
Throws an IllegalArgumentException if the value is an empty string or
null
|
public StringUtil()
public static int countLines(String theString)
public static String chomp(String theLine)
public static void validateNotEmpty(String theValue)
public static String replace(String theString, String theMatch, String theReplacement)
public static String[] concatenate(String[] array1, String[] array2)
public static boolean isBlank(String theString)
true
if the string is null, or contains no non-whitespace characterspublic static boolean isNotBlank(String theString)
isBlank(String)
Copyright © 2001–2017 University Health Network. All rights reserved.