-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest9.java
More file actions
26 lines (23 loc) · 846 Bytes
/
Copy pathTest9.java
File metadata and controls
26 lines (23 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package programmers;
public class Test9 {
public static void main(String[] args) {
String phone_number = "01033334444";
String[] str = phone_number.split("");
for (int i = 0; i < str.length - 4; i++) {
// str[i]='*';
}
}
}
// String a = phone_number.substring(0,phone_number.length()-4);
// String qqq = "*";
// System.out.println(qqq.repeat(phone_number.length()-4)+phone_number.substring(phone_number.length()-4,phone_number.length()));
// System.out.println(phone_number.replaceAll(".(?=.{4})", "*"));
//class Solution {
// public String solution(String phone_number) {
// char[] ch = phone_number.toCharArray();
// for(int i = 0; i < ch.length - 4; i ++){
// ch[i] = '*';
// }
// return String.valueOf(ch);
// }
//}