package com.meritit.test;

public class TestChart {
public static void main(String[] args) throws Exception {
String aa = "中国China人";
for (int i = 0; i < aa.length(); i++) {
String bb = aa.substring(i, i + 1);
boolean cc = java.util.regex.Pattern.matches("[\u4E00-\u9FA5]", bb);
if (cc) {
System.out.println(bb);
}
}
}
}

java中判断字符串中是否有中文字符的更多相关文章

  1. Java:判断字符串中包含某字符的个数

    Java:判断字符串中包含某字符的个数 JAVA中查询一个词在内容中出现的次数: public int getCount(String str,String key){ if(str == null ...

  2. Java如何判断字符串中包含有全角,半角符号

    首先介绍下全角跟半角之间的区别: 在计算机屏幕上,一个汉字要占两个英文字符的位置,人们把一个英文字符所占的位置称为"半角",相对地把一个汉字所占的位置称为"全角" ...

  3. SQL中判断字符串中包含字符的方法

    通过2个函数CHARINDEX和PATINDEX以及通配符的灵活使用 函数:CHARINDEX和PATINDEX CHARINDEX:查某字符(串)是否包含在其他字符串中,返回字符串中指定表达式的起始 ...

  4. C#中判断字符串中包含某个字符

    C#判断字符串是否存在某个字符,如果存在进行替换.   //定义一个字符串 string  str=".net/Java/asp.net"; //检验“/” if(str.Cont ...

  5. JS中判断字符串中出现次数最多的字符及出现的次数

    <script type="text/javascript"> var str = 'qwertyuilo.,mnbvcsarrrrrrrrtyuiop;l,mhgfd ...

  6. c# 数组 字符串 C#中判断字符串中包含某个字符

    string str = "1,2,3,4,5,6,7";            string[] strArray = str.Split(','); //字符串转数组      ...

  7. Java 完美判断字符串中中文字符【中文符号】

    package com.cmc.util; import java.util.regex.Pattern; public class CharUtil { public static void mai ...

  8. php中判断字符串是否全是中文或含有中文的实现代码

    <?php header('Content-type:text/html; charset=utf-8'); $str = '你好'; if(preg_match('/^[\x{4e00}-\x ...

  9. Java中判断字符串中相同字符的个数

    public static int countStr(String str1, String str2) { int counter=0; if (str1.indexOf(str2) == -1)  ...

随机推荐

  1. bootstrap课程3 bootstrap中常用的排版样式有哪些

    bootstrap课程3 bootstrap中常用的排版样式有哪些 一.总结 一句话总结:bootstrap里面对常用表情比如p.h1.code等html中的常用表情都修改了样式,照着手册用就好,样式 ...

  2. Java 开发规约插件

    阿里巴巴 Java 开发规约插件初体验 阿里巴巴 Java 开发手册 又一次来谈<阿里巴巴 Java 开发手册>,经过这大半年的版本迭代,这本阿里工程师们总结出来避免写出那么多 Bug 的 ...

  3. ZOJ 1108 FatMouse's Speed (HDU 1160) DP

    传送门: ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=108 HDU :http://acm.hdu.edu.cn/s ...

  4. php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结)

    php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结) 一.总结 从外到内解决网站大流量高并发问题---从提交一个url开始(从用户按下搜索栏回车键开始) url最开始会到d ...

  5. matplotlib学习之函数积分图

    # coding:utf-8 import numpy as np from matplotlib import pyplot as plt from matplotlib.patches impor ...

  6. [Angular] Using useExisting provider

    Unlike 'useClass', 'useExisting' doesn't create a new instance when you register your service inside ...

  7. 【2001】关于N!的问题

    Time Limit: 3 second Memory Limit: 2 MB 编写程序,计算n!以十进制数形式表示的数中最右边一个非零数字,并找出在它右边有几个零. 例如:12!=1*2*3*4*5 ...

  8. 【poj2528】Mayor's posters

    Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 59254   Accepted: 17167 Description The ...

  9. [Javascript] Identify and Deal with NaN in JavaScript

    Dealing with the special NaN value can be tricky in JavaScript. It behaves like a number and not a n ...

  10. try catch finally中的return

    try catch 中finally语句总是可以执行的,不管try中是否含有return语句 public class TestReturn { public static void main(Str ...