|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.StringUtil
public final class StringUtil
The StringUtil contains string dependent utility methods.
| Method Summary | |
|---|---|
static String |
formatHumanReadable(String pName)
Formats a text label with upper and lower case characters, e.g: first_nr -> First Nr The character _ will be replaced
with space. |
static String |
formatInitCap(String pName)
Sets the first character in each word to uppercase and the rest to lowercase. |
static String |
formatInitCap(String pName,
boolean pRemoveSpaces)
Sets the first character in each word to uppercase and the rest to lowercase. |
static String |
formatMemberName(String pName)
Formats a member name. |
static String |
formatMethodName(String pPrefix,
String pName)
Formats a method name with a given property name and the method prefix. |
static String |
getAlphaNumeric(String pText)
Gets the alpha numeric characters from a string. |
static int[] |
getQuotedBoundaries(String sText)
Returns the boundaries of quoted strings. |
static boolean |
like(String pSource,
String pSearch)
Fast like search in Strings with the wildcards are * and ?. |
static int[] |
parseInteger(String pValues,
String pDelimiter)
Gets the int values from a string with delimiters. |
static String |
removeCharacters(String pText,
char[] pRemove)
Removes specific characters from a string. |
static String |
removeQuotes(String pText,
String pQuote)
Removes the begin and end quote of strings, e.g. |
static String |
removeQuotes(String pText,
String pStartQuote,
String pEndQuote)
Removes the begin and end quote of strings, e.g. |
static ArrayUtil<String> |
separateList(String pList,
String pDelimiter,
boolean pTrim)
Separates a string of values with a configurable delimiter. |
static String |
toString(Object pObject)
Returns a string representation of the "deep contents" of the specified object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int[] getQuotedBoundaries(String sText)
unitTest("Test", Application.class, " Application.class");
unitTest("Test\", Application.class", Application.class");
unitTest("Test", Application.class", Application.class);
sText - the text with our without quotes
public static ArrayUtil<String> separateList(String pList,
String pDelimiter,
boolean pTrim)
pList - string with valuespDelimiter - delimiter to separatepTrim - true to trim the separated values
public static int[] parseInteger(String pValues,
String pDelimiter)
pValues - the string with numbers and delimiterspDelimiter - the delimiter
null if the values are null or empty
public static boolean like(String pSource,
String pSearch)
pSource - any stringpSearch - search pattern with the wildcards are * and ?.
public static String formatHumanReadable(String pName)
_ will be replaced
with space.
pName - the unformatted label
public static String formatInitCap(String pName)
pName - the unformatted text
public static String formatInitCap(String pName,
boolean pRemoveSpaces)
pName - the unformatted textpRemoveSpaces - true to remove whitespaces and '_' characters from the result
public static String formatMethodName(String pPrefix,
String pName)
pPrefix - the method prefixpName - the property name
public static String formatMemberName(String pName)
pName - the member name
public static String getAlphaNumeric(String pText)
pText - any text
public static String removeCharacters(String pText,
char[] pRemove)
pText - a stringpRemove - the characters which should be removed
public static String toString(Object pObject)
The string representation consists of a list of the object's elements, enclosed in brackets ("[]" or "{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space).
To avoid infinite recursion, if the specified object contains itself as an element, or contains an indirect reference to itself through one or more levels of arrays, the self-reference is converted to the string "#REF#". For example, an array containing only a reference to itself would be rendered as "[#REF#]".
This method returns "null" if the specified object is null.
pObject - the object whose string representation to return
public static String removeQuotes(String pText,
String pQuote)
'text' will be translated to text
pText - the quoted textpQuote - the quote character e.g. ' or "
pText without begin and end quote
public static String removeQuotes(String pText,
String pStartQuote,
String pEndQuote)
'text' will be translated to text
pText - the quoted textpStartQuote - the start quote character e.g. ' or " or (pEndQuote - the end quote character e.g. ' or " or )
pText without begin and end quote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||