CharSequenceUtils¶
- public class org.apache.commons.lang3.CharSequenceUtils[source]¶
Operations on
CharSequencethat arenullsafe.- Since:
3.0
- See also:
Constructors¶
Deprecated. |
- @Deprecated public CharSequenceUtils()[source]¶
Deprecated: TODO Make private in 4.0.
CharSequenceUtilsinstances should NOT be constructed in standard programming.This constructor is public to permit tools that require a JavaBean instance to operate.
Methods¶
|
Returns a new |
|
|
Converts the given CharSequence to a char[]. |
- public static CharSequence subSequence(CharSequence cs, int start)[source]¶
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 null.
start – The start index, inclusive, valid.
- Returns:
A new subsequence, may be null.
- Throws:
IndexOutOfBoundsException– Thrown ifstartis negative or ifstartis greater thanlength().
- public static char[] toCharArray(CharSequence source)[source]¶
Converts the given CharSequence to a char[].
- Parameters:
source – The
CharSequenceto be processed.- Returns:
The resulting char array, never null.
- Since:
3.11