例如,下列代码在字符串“Hello Java”中查找字母v 的索引位置。 复制纯文本复制. String s = "Hello Java";; int size = s.indexOf('v'); // size的结果为8.
確定! 回上一頁