startsWith()和 endWith()方法进行简单的身份验证
来源:互联网 发布:淘宝二楼 编辑:程序博客网 时间:2024/05/22 00:35
public class IdentifyCheck {
public static void main(String[] args) {
String ID = "410212198502130628";
//定义变量 ID,保存身份证号码
String name = "先生";
String address = "未知";
if (ID.startsWith("410")) {
//如果身份证以“410”开头
address = "郑州市";
}
//判断性别,单数为男性,偶数为女性
for (int i = 0; i < 10; i++, i++) {
//循环所有的偶数(个位)
String endChar = "" + i;
//将一位偶数变为字符串
if (ID.endsWith(endChar)) {
//如果 ID 以偶数结尾
name = "女士";
//改变称呼
break;
}
}
System.out.println(name + ",您的地址:" + address);//输出信息
}
}
0 0
- startsWith()和 endWith()方法进行简单的身份验证
- 字符串的startsWith和endWith方法
- java字符串startsWith和endWith方法
- Pandas 文本数据方法 startswith( ) endwith( )
- java endsWith()和startsWith方法的解释
- javascript中的startWith和endWith的原型扩展方法
- javascript自定义startWith()和endWith()方法
- js 中startWith 和 endWith 方法
- JS的trim() startWith() endWith() 方法
- Python的startswith和endswith
- Python的startswith和endswith
- Python的startswith和endswith
- Python的 startswith 和endswith
- line.startsWith(tem)-----startsWith(),endsWith()的作用和用法
- js中startWith和endWith的扩展
- EL 表达式 访问集合和String的 的内置方法(比如:size ,contains, indexOf ,endWith...)
- String的一些基本操作(startsWith、split)和JS中的match、search和replace方法
- JavaScript 构造 endwith()方法
- 关于checkBox,radio和select标签的一些常见问题总结
- android应用程序遇到程序关闭后重启的问题
- Burp Suite使用详解
- C语言中,static的作用?
- 写出float x 与“零值”比较的if语句——一道面试题分析
- startsWith()和 endWith()方法进行简单的身份验证
- GIT 3 撤销
- Linux探针
- Oracle EBS 寄销/VMI(2)-->采购篇
- 唯品会控股乐蜂网,聚美陈欧惨过汪峰
- 八大排序算法总结
- android ListView几个比较特征的属性
- 你是一名努力工作的程序员,还是懒惰的程序员?
- NYOJ238 小明的调查统计