根据身份证号判断性别

//判断男MF
public static String parseGender(String cid) {

String gender = null;
char c = cid.charAt(cid.length()-2);
int sex = Integer.parseInt(String.valueOf(c));
if(sex%2==0){
gender = "F";
}else{
gender = "M";
}
return gender;
}
posted @ 2017-06-12 09:52  晴空~万里  阅读(937)  评论(1编辑  收藏  举报