Uploaded by sefadogan1

StringSummary

advertisement
11/6/12
The ASCII Subset of Unicode
Useful Methods in the Character Class
The letter
Unicode
following
A, for
value
table
example,
forshows
anyhas
character
the
the Unicode
firstin128
thevalue
table
characters
101
is the
sum
in the
ofisthe
Unicode
theoctal
sum
8, which
numbers
of
character
the rowat
set,
and
thewhich
column
beginning
arelabels.
the
ofsame
that row
as inand
thecolumn.
older ASCII scheme:
00x
01x
02x
03x
04x
05x
06x
07x
10x
11x
12x
13x
14x
15x
16x
17x
0
\000
\b
\020
\030
space
(
0
8
@
H
P
X
`
h
p
x
1
\001
\t
\021
\031
!
)
1
9
A
I
Q
Y
a
i
q
y
2
\002
\n
\022
\032
"
*
2
:
B
J
R
Z
b
j
r
z
3
\003
\011
\023
\033
#
+
3
;
C
K
S
[
c
k
s
{
4
\004
\f
\024
\034
$
,
4
<
D
L
T
\
d
l
t
|
5
\005
\r
\025
\035
%
5
=
E
M
U
]
e
m
u
}
6
\006
\016
\026
\036
&
.
6
>
F
N
V
^
f
n
v
~
Methods in the String Class
7
\007
\017
\027
\037
'
/
7
?
G
O
W
_
g
o
w
\177
static boolean isDigit(char ch)
Determines if the specified character is a digit.
static boolean isLetter(char ch)
Determines if the specified character is a letter.
static boolean isLetterOrDigit(char ch)
Determines if the specified character is a letter or a digit.
static boolean isLowerCase(char ch)
Determines if the specified character is a lowercase letter.
static boolean isUpperCase(char ch)
Determines if the specified character is an uppercase letter.
static boolean isWhitespace(char ch)
Determines if the specified character is whitespace (spaces and tabs).
static char toLowerCase(char ch)
Converts ch to its lowercase equivalent, if any. If not, ch is returned unchanged.
static char toUpperCase(char ch)
Converts ch to its uppercase equivalent, if any. If not, ch is returned unchanged.
Other Methods in the String Class
int length()
int lastIndexOf(char ch) or lastIndexOf(String str)
char charAt(int index)
boolean equalsIgnoreCase(String str)
String concat(String s2)
boolean startsWith(String str)
String substring(int i, int j), substring(int i)
boolean endsWith(String str)
boolean equals(String s2)
String replace(char c1, char c2)
int compareTo(String s2)
String trim()
int indexOf(char c), int indexOf(String s)
String toLowerCase()
int indexOf(char c,int i),indexOf(String s,int i)
String toUpperCase()
Returns the length of the string.
Returns the character at the specified index.
Returns a new string with the receiver and s2 concatenated.
Returns the substring beginning at i up to but not including j (or end of string).
Returns true if the string s2 is equal to the receiver.
Returns a number whose sign gives how the strings compare lexicographically.
Returns the index of the first occurrence of c or s, or -1 if they do not occur.
Like indexOf with one argument, but starts search at index i.
Returns the index of the last match of the argument, or -1 if none exists.
Returns true if this string and str are the same, ignoring differences in case.
Returns true if this string starts with str.
Returns true if this string starts with str.
Returns a copy of this string with all instances of c1 replaced by c2.
Returns a copy of this string with leading and trailing whitespace removed.
Returns a copy of this string with all uppercase characters changed to lowercase.
Returns a copy of this string with all lowercase characters changed to uppercase
1
Download