Package org.apache.commons.lang3
Class CharSequenceUtils
- java.lang.Object
-
- org.apache.commons.lang3.CharSequenceUtils
-
public class CharSequenceUtils extends Object
Operations on
CharSequencethat arenullsafe.- Since:
- 3.0
- See Also:
CharSequence
-
-
Constructor Summary
Constructors Constructor Description CharSequenceUtils()CharSequenceUtilsinstances should NOT be constructed in standard programming.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CharSequencesubSequence(CharSequence cs, int start)Returns a newCharSequencethat is a subsequence of this sequence starting with thecharvalue at the specified index.
-
-
-
Method Detail
-
subSequence
public static CharSequence subSequence(CharSequence cs, int start)
Returns a new
CharSequencethat is a subsequence of this sequence starting with thecharvalue at the specified index.This provides the
CharSequenceequivalent toString.substring(int). The length (inchar) of the returned sequence islength() - start, so ifstart == endthen an empty sequence is returned.- Parameters:
cs- the specified subsequence, null returns nullstart- the start index, inclusive, valid- Returns:
- a new subsequence, may be null
- Throws:
IndexOutOfBoundsException- ifstartis negative or ifstartis greater thanlength()
-
-