|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.aavalla.utils.general.StrUtils
public class StrUtils
Utilities for manipulating String objects.
Constructor Summary | |
---|---|
StrUtils()
|
Method Summary | |
---|---|
static java.lang.String |
asString(double d)
|
static java.lang.String |
asString(double d,
int minDecimals,
int maxDecimals)
|
static java.lang.String |
catStrings(java.lang.Object[] strings,
java.lang.String separator)
Concatenates strings, puts separator between them and returns the result. |
static java.lang.String |
catStringTimes(java.lang.String string,
java.lang.String separator,
int c)
Returns a string concatenated with itself a number of times with a separator string added in between. |
static boolean |
containsPattern(java.lang.String test,
java.util.regex.Pattern pattern)
Checks whether any substring in a string matches given pattern |
static java.lang.String |
escapeUnwanted(java.lang.String source,
java.util.regex.Pattern unwanted,
java.lang.String escapePre,
java.lang.String escapePost)
Escapes any substrings matching given pattern |
static java.lang.String |
removeUnwanted(java.lang.String source,
java.util.regex.Pattern unwanted)
Removes any substrings matching given pattern |
static java.lang.String[] |
slice(java.lang.String sourceString,
int sliceLength)
Slices a string to substrings of given length and return them as an array of strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StrUtils()
Method Detail |
---|
public static boolean containsPattern(java.lang.String test, java.util.regex.Pattern pattern)
test
- string to test matching forpattern
- the pattern
public static java.lang.String removeUnwanted(java.lang.String source, java.util.regex.Pattern unwanted)
source
- source string to remove matches fromunwanted
- pattern of unwanted substrings
public static java.lang.String escapeUnwanted(java.lang.String source, java.util.regex.Pattern unwanted, java.lang.String escapePre, java.lang.String escapePost)
source
- source string to escapeunwanted
- unwanted patternescapePre
- string to add before any unwanted patternescapePost
- string to add after any unwanted pattern
public static java.lang.String catStrings(java.lang.Object[] strings, java.lang.String separator)
strings
- Array of Strings to catenateseparator
- Added between concatenated strings
public static java.lang.String catStringTimes(java.lang.String string, java.lang.String separator, int c)
string
- String to concatenate with itselfseparator
- Added between concatenated stringsc
- Number of times
public static java.lang.String[] slice(java.lang.String sourceString, int sliceLength)
sourceString
- Original stringsliceLength
- length of a slice
public static java.lang.String asString(double d)
public static java.lang.String asString(double d, int minDecimals, int maxDecimals)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |