is Valid English Or Chinese Or Number - Android Internationalization

Android examples for Internationalization:Chinese

Description

is Valid English Or Chinese Or Number

Demo Code

import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main{


    public static boolean isValidEngOrChOrNum(String s) {
        if (null == s) {
            return false;
        }/* www. j  av a2 s. com*/
        Pattern pattern = Pattern.compile("[\u4E00-\u9FA5A-Za-z0-9]*$");
        Matcher matcher = pattern.matcher(s);
        return matcher.matches();
    }

}

Related Tutorials