---
title: "java中对中文的判断"
author: "haiker"
date: "2011-03-06T19:47:14Z"
tags: []
categories: ["编程语言"]
slug: "java"
draft: false
lastmod: "2011-03-06T19:47:14Z"
id: 943152
url: "https://haiker.iteye.com/blog/943152"
---

答案使用正则式

```
Pattern ptn = Pattern.compile("[\u4e00-\u9fa5]");
        if("中".matches("[\u4e00-\u9fa5]")) {
            System.out.println("中文");
        }
```