判断java标识符
2020-12-28 04:31
标签:span col public aci dig oid pack erp through 判断java标识符 标签:span col public aci dig oid pack erp through 原文地址:https://www.cnblogs.com/lingtongwanr/p/13029832.html1 package com.jdk7.chapter5;
2
3 public class JavaIdentifier {
4
5 /**
6 * 使用Character.isJavaIdentifierPart判断字符是否属于java标识符
7 it is a letter
8 it is a currency symbol (such as ‘$‘)
9 it is a connecting punctuation character (such as ‘_‘)
10 it is a digit
11 it is a numeric letter (such as a Roman numeral character)
12 it is a combining mark
13 it is a non-spacing mark
14 ‘\u005Cu0000‘ through ‘\u005Cu0008‘
15 ‘\u005Cu000E‘ through ‘\u005Cu001B‘
16 ‘\u005Cu007F‘ through ‘\u005Cu009F‘
17 * @param str
18 * @return
19 */
20 public static boolean isJavaIdentifier(String str){
21 if(str==null || str.length()==0){
22 return false;
23 }
24 char[] ch = str.toCharArray();
25 for(int i=0;i
上一篇:C语言实验报告(七)
下一篇:用ASP来简化通信程序的创建