public class StringUtil extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
containsIgnoreCase(String haystack,
String needle)
Does a string contain a substring ignoring case?
|
static boolean |
endsWithIgnoreCase(String haystack,
String needle)
Does a string end with a second string ignoring case?
|
static boolean |
startsWithIgnoreCase(String haystack,
String needle)
Does a string start with a second string ignoring case?
|
static String |
trim(String str)
Trims new line, tabulator, apostrophe and double quotes from a string.
|
static String |
trim(String str,
String trimStr)
Trims characters from the begging and end of a string.
|
static String |
trimLines(String multiline)
Removes white spaces from beginning and end of each line.
|
public static boolean startsWithIgnoreCase(String haystack, String needle)
haystack
- A string to be searched.needle
- A potential prefix.public static boolean endsWithIgnoreCase(String haystack, String needle)
haystack
- A string to be searched.needle
- A potential suffix.public static boolean containsIgnoreCase(String haystack, String needle)
haystack
- A string to be searched.needle
- A potential substring.public static String trim(String str)
str
- A string to be trimmed.public static String trim(String str, String trimStr)
str
- A string to be trimmed.trimStr
- A string with characters to be trimmed. Any of the characters in this string are removed from the first parameter.public static String trimLines(String multiline)
multiline
- A string with multiple lines.Copyright © 2010–2017 PerfCake Community. All rights reserved.