摘要:
java indexOf()方法 indexOf()方法,属于 String类 中的方法。 indexOf()方法,有四种形式的用法: public int indexOf(int ch) 返回指定字符ch在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回-1。 public int 阅读全文
摘要:
Java charAt() 方法 charAt(),用于返回指定索引处的字符,索引范伟从0到str.length()-1(字符串长度减去1,因索引是从0开始的) 语法: public char charAt(int index) 参数: index 是字符的索引。 返回值:返回指定索引处的字符。 p 阅读全文