글
String class의 split
JAVA
2014. 2. 18. 13:54
spilt method를 이용하여서 string을 분리할수 있다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public class Mytest { public static void main(String[] args) { String teststring = "fuck_suck"; String[] temp; temp = teststring.split("_"); for(String sam : temp){ System.out.println(sam); } } } |