๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ์ƒํ™œ/Java

[JAVA] ๋Œ€๋ฌธ์ž ์•ž์— ๊ณต๋ฐฑ ์ถ”๊ฐ€

by cocococo331 2022. 3. 22.
String originText = "CocoHiByeHaha331";
String CapitalSpaceText = text.replaceAll("\\d+", "").replaceAll("(.)([A-Z])", "$1 $2");

-> Coco Hi Bye Haha
์ˆซ์ž ์ œ๊ฑฐ ํ›„ ๋Œ€๋ฌธ์ž ์•ž์— ๋„์–ด์“ฐ๊ธฐ ์ถ”๊ฐ€