String phone="18678473547"; String phones = phone.substring(0,phone.length()-(phone.substring(3)).length())+"****"+phone.substring(7); System.out.println(phones);//结果:185****3547
时间: 2024-11-05 14:54:04
String phone="18678473547"; String phones = phone.substring(0,phone.length()-(phone.substring(3)).length())+"****"+phone.substring(7); System.out.println(phones);//结果:185****3547