gistfile1.txt tv_phone.setText(strPhone); tv_name.setText(strName); if (strName !=null){ //取字符串的第一个位 tv_name.setText(strName.substring(0,1)+"师傅"); } if (strPhone != null !"".equals(strPhone) strPhone.length() == 11) {
tv_phone.setText(strPhone); tv_name.setText(strName); if (strName !=null){ //取字符串的第一个位 tv_name.setText(strName.substring(0,1)+"师傅"); } if (strPhone != null && !"".equals(strPhone) && strPhone.length() == 11) { tv_phone.setText(strPhone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); }