Created
September 15, 2019 05:34
-
-
Save youngjinmo/8dcf4b120ceed2cafe385935b612f507 to your computer and use it in GitHub Desktop.
String형 받아서 String형 배열로 변환하기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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