Skip to content

Instantly share code, notes, and snippets.

@youngjinmo
Created September 15, 2019 05:34
Show Gist options
  • Save youngjinmo/8dcf4b120ceed2cafe385935b612f507 to your computer and use it in GitHub Desktop.
Save youngjinmo/8dcf4b120ceed2cafe385935b612f507 to your computer and use it in GitHub Desktop.
String형 받아서 String형 배열로 변환하기
import java.util.Arrays;
public class str2strArray{
public static void main(String[] args){
String data = "Hello world";
String[] strArray = data.split("");
System.out.println(Arrays.toString(strArray));
// [H, e, l, l, o, w, o, r, l, d]
Sysrtem.out.println(strArray[0]);
// H
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment