is new.
,
StringBuilder
A
CharSequence
is a readable sequence of
char values.
characters.
This interface provides uniform, read-only access to many different kinds of
char
character
sequences.
A char value represents a character in the
Basic Multilingual Plane (BMP)
or a surrogate. Refer to
Unicode Character Representation
for details.
This interface does not refine the general contracts of the equals and hashCode methods. The result of comparing two objects that implement CharSequence is therefore, in general, undefined. Each object may be implemented by a different class, and there is no guarantee that each class will be capable of testing its instances for equality with those of the other. It is therefore inappropriate to use arbitrary CharSequence instances as elements in a set or as keys in a map.
| Method Summary | |
|---|---|
| char |
charAt
(int index) Returns the
char value
|
| int |
length
() Returns the length of this character sequence. |
| CharSequence |
subSequence
(int start, int end) Returns a new
CharSequence
|
| String |
toString
() Returns a string containing the characters in this sequence in the same order as this sequence. |
| Method Detail |
|---|
int length()
chars
chars
char charAt(int index)
char value
char value
If the char value specified by the index is a
surrogate
, the surrogate value is returned.
char value
char value
CharSequence subSequence(int start,
int end)
CharSequence
char value
char value
(in chars)
of the returned sequence is
end - start
, so if
start == end
then an empty sequence is returned.
String toString()