org.jopendocument.util
Class StringUtils
java.lang.Object
org.jopendocument.util.StringUtils
public class StringUtils
- extends Object
- Author:
- Sylvain CUAZ
|
Method Summary |
static String |
doubleQuote(String s)
|
static List<String> |
fastSplit(String string,
char sep)
|
static String |
firstUp(String s)
|
static String |
firstUpThenLow(String s)
Retourne la chaine avec la première lettre en majuscule et le reste en minuscule. |
static String |
getBoundedLengthString(String s,
int maxLength)
Return a string built from s that is at most maxLength long. |
static String |
getFixedWidthString(String s,
int width,
StringUtils.Side align)
|
static String |
getFixedWidthString(String s,
int width,
StringUtils.Side align,
boolean allowTruncate)
|
static int |
getLeastMaximum()
The minimum value for getBoundedLengthString(String, int). |
static String |
leftAlign(String s,
int width)
|
static String |
limitLength(String s,
int maxLength)
|
static String |
removeAllSpaces(String text)
|
static String |
removeNonDecimalChars(String text)
|
static String |
rightAlign(String s,
int width)
|
static String |
splitString(String s,
int nbCharMaxLine)
Split une string s tous les nbCharMaxLine |
static String |
trim(String s,
boolean leading)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UTF8
public static final Charset UTF8
UTF16
public static final Charset UTF16
ASCII
public static final Charset ASCII
ISO8859_1
public static final Charset ISO8859_1
ISO8859_15
public static final Charset ISO8859_15
Cp1252
public static final Charset Cp1252
Cp850
public static final Charset Cp850
StringUtils
public StringUtils()
firstUpThenLow
public static String firstUpThenLow(String s)
- Retourne la chaine avec la première lettre en majuscule et le reste en minuscule.
- Parameters:
s - la chaîne à transformer.
- Returns:
- la chaine avec la première lettre en majuscule et le reste en minuscule.
firstUp
public static String firstUp(String s)
getLeastMaximum
public static final int getLeastMaximum()
- The minimum value for
getBoundedLengthString(String, int).
- Returns:
- the minimum value for
maxLength.
getBoundedLengthString
public static final String getBoundedLengthString(String s,
int maxLength)
throws IllegalArgumentException
- Return a string built from
s that is at most maxLength long.
- Parameters:
s - the string to bound.maxLength - the maximum length the result must have.
- Returns:
- a string built from
s.
- Throws:
IllegalArgumentException - if maxLength is too small.- See Also:
getLeastMaximum(),
StringUtils.Shortener.getBoundedLengthString(String, int)
getFixedWidthString
public static String getFixedWidthString(String s,
int width,
StringUtils.Side align)
getFixedWidthString
public static String getFixedWidthString(String s,
int width,
StringUtils.Side align,
boolean allowTruncate)
fastSplit
public static final List<String> fastSplit(String string,
char sep)
splitString
public static String splitString(String s,
int nbCharMaxLine)
- Split une string s tous les nbCharMaxLine
- Parameters:
s - nbCharMaxLine -
- Returns:
doubleQuote
public static String doubleQuote(String s)
rightAlign
public static String rightAlign(String s,
int width)
leftAlign
public static String leftAlign(String s,
int width)
trim
public static String trim(String s,
boolean leading)
limitLength
public static String limitLength(String s,
int maxLength)
removeAllSpaces
public static String removeAllSpaces(String text)
removeNonDecimalChars
public static String removeNonDecimalChars(String text)
Copyright © 2010 jOpenDocument All Rights Reserved.