计算某一个字符串中的大小写与其它字符
2016-03-19 21:53
246 查看
public class Test { public static void main(String[] args) { String s = "AaaaABBBBcc^%adfsfdCCOOkk99876_haHA"; int lCount = 0; int uCount = 0; int eCount = 0; for(int i=0;i<s.length();i++){ char c = s.charAt(i); if(c >='a' && c <='z'){ lCount++; }else if(c >='A' && c <='Z'){ uCount++; }else{ eCount++; } } System.out.println(lCount + " " + uCount + " " + eCount); } }
相关文章推荐
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) A. Bear and Three Balls 水题
- 别傻了,人家离职你也离
- 公告 我的另外一个博客
- 搬圆桌问题
- const, static, const static
- jquery扩展方法
- Harmonic Number(调和级数+欧拉常数)
- 大数据量高并发访问的数据库优化方法
- Http协议与TCP协议简单理解
- 创建第一个Spring MVC程序helloworld
- Linux 终端的一些动画命令
- [Coursera]计算机组成_Week3_Mips_Q2
- 初识MVC
- 北化oj 2106-程序改错 - scanf中%c
- Python Static method vs class method
- POJ 1797 kruskal 算法
- eclipse不能新建server
- 第五十七天
- linux输入子系统概念介绍
- 教你如何使用Java泛型