java--charAt()
2017-10-16 20:07
218 查看
public class TestString{ public static void main(String[] args) { int lowCount=0,hCount=0,oCount=0; String S="alhjfweoihfHIFGIUE154355644164"; for(int i=0;i<S.length();i++) { char c=S.charAt(i); if(c>='a'&&c<='z') { lowCount++; }else if(c 7534 >='A'&&c<='Z') { hCount++; }else { oCount++; } } System.out.println(lowCount+" "+hCount+" "+oCount); } }
charAt(index) 返回指定索引处index的 char 值
相关文章推荐
- Java charAt() 方法
- java StringBuffer类型删除最末位字符(使用deleteCharAt方法)
- java.lang.String-firstMethod-charAt()
- JAVA中的charAt()和toCharArray()
- java string charAt length()疑惑
- java代码反转toCharAT()的用法
- java代码------charAt()的用法
- java charAt返回char,不是int
- JAVA insert() 插入字符串 reverse() 颠倒 delete()和deleteCharAt() 删除字符 replace() 替换 substring() 截取子串
- Java中String类的length()、charAt()、getChars()、replace()、toUpperCase()、toLowerCase()、trim()、toCharArray()使用说明
- java中charAt()方法的使用
- Java.toCharArray()和charAt()效率比较
- Java String charAt()方法
- java中charAt()与toCharArray(),indexOf的综合使用
- java中charAt与toCharArray以及split用法
- java中的charAt(),substring(a,b),indexOf(),lastindexof()等的用法
- Java String charAt()方法
- CharAtString.java
- java中substring的用法和charAt()的用法
- Java String charAt()方法