|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtend.backend.util.StringHelper
public final class StringHelper
This class is a collection of helper functions for string handling.
Constructor Summary | |
---|---|
StringHelper()
|
Method Summary | |
---|---|
static boolean |
endsWithAny(java.lang.String str,
java.util.Collection<java.lang.String> prefixes)
tests if a string ends with any one of a collection of prefixes |
static boolean |
endsWithAny(java.lang.String str,
java.lang.String[] prefixes)
tests if a string ends with any one of a collection of prefixes |
static java.lang.String |
escape(java.lang.String src)
replaces special characters that affect formatting with non-formatting character sequences. |
static java.lang.String |
firstLower(java.lang.String str)
|
static java.lang.String |
firstUpper(java.lang.String str)
|
static java.lang.String |
getTypeAsString(java.lang.Object o)
|
static java.util.List<java.lang.String> |
getTypesAsString(java.util.List<?> l)
|
static int |
numMatches(java.lang.String s,
char ch)
returns the number of occurrences of a character in a string |
static int |
numMatches(java.lang.String s,
java.lang.String search)
returns the number of occurrences of a substring in a string |
static java.lang.String |
prettyPrint(java.util.Date date)
formats a date using the default locale settings. |
static java.lang.String |
prettyPrint(long num)
formats a number using the default locale settings. |
static java.lang.String |
prettyPrint(java.lang.Number num)
formats a number using the default locale settings. |
static java.lang.String |
replace(java.lang.String src,
java.lang.String search,
java.lang.String replace)
returns a new string in which one search string is replaced by another. |
static boolean |
startsWithAny(java.lang.String str,
java.util.Collection<java.lang.String> prefixes)
tests if a string starts with any one of a collection of prefixes |
static boolean |
startsWithAny(java.lang.String str,
java.lang.String[] prefixes)
tests if a string starts with any one of a collection of prefixes |
static java.lang.String |
strip(java.lang.String s,
int numStart,
int numEnd)
removes a number of characters from the beginning and the end of a string |
static java.lang.String |
substring(java.lang.String str,
int beginIndex)
same as String.substring, except that this version handles the case robustly when the index is out of bounds. |
static java.lang.String |
substring(java.lang.String str,
int beginIndex,
int endIndex)
same as String.substring, except that this version handles the case robustly when one or both of the indexes is out of bounds. |
static java.lang.String |
truncate(java.lang.String str,
int maxLen)
truncates a string regardless of its length. |
static java.lang.String |
unescape(java.lang.String src)
undoes the operations of escape |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringHelper()
Method Detail |
---|
public static java.lang.String getTypeAsString(java.lang.Object o)
public static java.util.List<java.lang.String> getTypesAsString(java.util.List<?> l)
public static java.lang.String prettyPrint(long num)
public static java.lang.String prettyPrint(java.lang.Number num)
public static java.lang.String prettyPrint(java.util.Date date)
public static java.lang.String replace(java.lang.String src, java.lang.String search, java.lang.String replace)
public static java.lang.String escape(java.lang.String src)
public static java.lang.String unescape(java.lang.String src)
escape
public static java.lang.String truncate(java.lang.String str, int maxLen)
public static java.lang.String substring(java.lang.String str, int beginIndex)
public static java.lang.String substring(java.lang.String str, int beginIndex, int endIndex)
public static java.lang.String strip(java.lang.String s, int numStart, int numEnd)
public static int numMatches(java.lang.String s, char ch)
public static int numMatches(java.lang.String s, java.lang.String search)
public static boolean startsWithAny(java.lang.String str, java.util.Collection<java.lang.String> prefixes)
public static boolean startsWithAny(java.lang.String str, java.lang.String[] prefixes)
public static boolean endsWithAny(java.lang.String str, java.util.Collection<java.lang.String> prefixes)
public static boolean endsWithAny(java.lang.String str, java.lang.String[] prefixes)
public static java.lang.String firstUpper(java.lang.String str)
public static java.lang.String firstLower(java.lang.String str)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |