Methods Summary |
---|
public static java.lang.String | UpperCaseFirstLetter(java.lang.String s)
if(s == null || s.length() <= 0)
return s;
return s.substring(0, 1).toUpperCase() + s.substring(1);
|
public static boolean | isEmpty(java.lang.String s)
if((s != null) && (! s.trim().equals(""))) // NOI18N
{
return false;
}else
{
return true;
}
|
public static void | main(java.lang.String[] args)
String[] test = new String[] { "xyz", "HITHERE", "123aa", "aSSS", "yothere" };//NOI18N
for(int i = 0; i < test.length; i++)
{
System.out.println(test[i] + " >>> " + UpperCaseFirstLetter(test[i]));//NOI18N
}
|
public static java.lang.String | padLeft(java.lang.String s, int len)
if(s == null || s.length() >= len)
return s;
String ret = ""; // NOI18N
for(int i = len - s.length(); i > 0; --i)
ret += ' ";
return ret + s;
|
public static java.lang.String | padRight(java.lang.String s, int len)
if(s == null || s.length() >= len)
return s;
for(int i = len - s.length(); i > 0; --i)
s += ' ";
return s;
|
public static java.lang.String | replace(java.lang.String s, java.lang.String token, java.lang.String replace)
if(s == null || s.length() <= 0 || token == null || token.length() <= 0)
return s;
int index = s.indexOf(token);
if(index < 0)
return s;
int tokenLength = token.length();
String ret = s.substring(0, index);
ret += replace;
ret += s.substring(index + tokenLength);
return ret;
|
public static java.lang.String | toShortClassName(java.lang.String className)
int index = className.lastIndexOf('.");
if(index >= 0 && index < className.length() - 1)
return className.substring(index + 1);
return className;
|