728x90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// ์์
// replace
String str7 = "A*B*C*D";
String reStr = str7.replace("*", ""); //ABCD ์ถ๋ ฅ
//new ์ ๋ฐ๊พธ๊ณ ์ถ์ ๊ฒ ๋ฃ๊ธฐ
System.out.println(reStr);
String str88 = "๋๋ ๋ฐ๋์ ์ฑ๊ณตํ ์ ์ ์ต๋๋ค.";
String reStr2 = str88.replace(" ", " ");
System.out.println(reStr2);
// ํ์นธ ์ด๊ธฐ๋ ๊ฐ๋ฅํ๋ค.
|
cs |
๋ณ์. replace( old char, new char);
.replace( ๋ณ๊ฒฝํ๊ณ ์ถ์๋ด์ฉ , ๋ณ๊ฒฝํ ๋ด์ฉ);
๋๊ธ