•
字符串调用
getChars
方法将当前字符串中的一部分字符拷贝到参数
c
指定的数组中,语法格式如下:
•
public void
getChars
(
int
start
,
int
end, char c[],
int
offset)
•
将字符串中从位置
start
到
end-1
的字符拷贝到数组
c
中,并从数组
c
的
offset
处开始存放这些字符。需要注意的是,必须保证数组
c
(从
offset
开始)能容纳下要被拷贝的字符。
•
charAt
(
index
)方法可以获取字符串中的一个字符
§
例如:
charAt
(
0
)表示获取字符串中的第一个字符。