java.lang.Objectorg.objectweb.telosys.util.StrUtil
Method Summary | |
static int |
countChar(java.lang.String s,
char c)
Count the number of occurrence of the given chararcter in the given string |
static boolean |
getBoolean(java.lang.String sVal)
|
static java.sql.Date |
getDateFR(java.lang.String sDate)
Return a date instance from a date in French format |
static java.sql.Date |
getDateISO(java.lang.String sDate)
Return a date instance from a date in ISO format |
static double |
getDouble(java.lang.String sVal)
|
static double |
getDouble(java.lang.String sVal,
double dDefaultValue)
|
static int |
getInt(java.lang.String sVal)
|
static int |
getInt(java.lang.String sVal,
int iDefaultValue)
|
static java.lang.String |
getLimitedString(java.lang.String sVal,
int iMaxLength)
|
static java.lang.String |
getProtectedString(java.lang.String sVal)
|
static boolean |
isFirstCharAlpha(java.lang.String s)
Returns TRUE if the first character of the string is an alphabetic character ( from 'a' to 'z' and from 'A' to 'Z' ) |
static java.lang.String |
notNull(java.lang.String s)
|
static boolean |
nullOrVoid(java.lang.String s)
Returns true if the given String is null or void ( "", " ", " " ) |
static java.lang.String |
removeQuotes(java.lang.String s,
char c)
Removes the quote characters if they are located at the first and last position of the string The string is returned "as is" if there's no quotes at the begining and at the end |
static java.lang.String |
replaceVar(java.lang.String s,
java.lang.String sVarName,
java.lang.String sVarValue)
Replace the given variable name by the given value |
static java.lang.String[] |
split(java.lang.String s,
char c)
Split a string using the given char as separator ( simple split without "reg exp" ) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int countChar(java.lang.String s, char c)
s
- c
-
public static boolean getBoolean(java.lang.String sVal)
sVal
- : the string to convert
public static java.lang.String getLimitedString(java.lang.String sVal, int iMaxLength)
sVal
- :iMaxLength
- :
public static java.lang.String getProtectedString(java.lang.String sVal)
sVal
- :
public static java.lang.String notNull(java.lang.String s)
s
- :
public static boolean nullOrVoid(java.lang.String s)
s
-
public static int getInt(java.lang.String sVal, int iDefaultValue)
sVal
- : String value to convertiDefaultValue
- : Default value if the string is null or contains an invalid integer value
public static int getInt(java.lang.String sVal)
sVal
- :
public static double getDouble(java.lang.String sVal, double dDefaultValue)
sVal
- : String value to convertdDefaultValue
- : Default value if the string is null or contains an invalid value
public static double getDouble(java.lang.String sVal)
sVal
- :
public static java.sql.Date getDateFR(java.lang.String sDate)
sDate
- : date in French format ( "DD/MM/YYYY" )
public static java.sql.Date getDateISO(java.lang.String sDate)
sDate
- : date in ISO format ( "YYYY-MM-DD" )
public static java.lang.String removeQuotes(java.lang.String s, char c)
s
- the stringc
- the quote character to use ( eg '\'', '"' )
public static java.lang.String[] split(java.lang.String s, char c)
s
- : the string to splitc
- : the separator
public static boolean isFirstCharAlpha(java.lang.String s)
s
-
public static java.lang.String replaceVar(java.lang.String s, java.lang.String sVarName, java.lang.String sVarValue)
s
- the initial string ( e.g. "bla bla bla ${MyVar} bla bla" )sVarName
- the variable name ( e.g. "${MyVar}" )sVarValue
- the variable value