net.sf.zekr.common.util
Class StringUtils
java.lang.Object
net.sf.zekr.common.util.StringUtils
public class StringUtils
- extends java.lang.Object
- Author:
- Mohsen Saboorian
Method Summary |
static java.lang.String |
abbreviate(java.lang.String str,
int size)
Similar to StringUtils.abbreviate(String, int) method but adds no
ellipsis to the end of the abbreviated string. |
static StringUtils.Region |
getNthRegion(java.lang.String src,
int n,
char delim)
|
static java.lang.String |
getNthWord(java.lang.String src,
int n,
char delim)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtils
public StringUtils()
getNthRegion
public static StringUtils.Region getNthRegion(java.lang.String src,
int n,
char delim)
getNthWord
public static java.lang.String getNthWord(java.lang.String src,
int n,
char delim)
main
public static void main(java.lang.String[] args)
abbreviate
public static java.lang.String abbreviate(java.lang.String str,
int size)
- Similar to
StringUtils.abbreviate(String, int)
method but adds no
ellipsis to the end of the abbreviated string. This method also abbreviates to the nearest space
character (\x20), so that the result string size is smaller or equal to size parameter.
This method returns an empty string if no space character found within the given size range.
- Parameters:
str
- string to be abbreviatedsize
- boundary to which the result size of abbreviated string is less or equal
- Returns:
- abbreviated string