- string to array
- string splits by every character
- str_split()
1 Java[ | ]

Java
Copy
public class MyClass {
public static void main(String args[]) {
String str = "ABC안녕123★";
char[] chs = str.toCharArray();
for(int i=0; i<chs.length; i++) System.out.printf("%c, ",chs[i]);
// A, B, C, 안, 녕, 1, 2, 3, ★,
}
}
Loading
2 JavaScript[ | ]
JavaScript
Copy
var chars = 'ABC안녕123★'.split('');
console.log( chars );
// ["A", "B", "C", "안", "녕", "1", "2", "3", "★"]
▶ | ["A", "B", "C", "안", "녕", "1", "2", "3", "★"] |
3 Perl[ | ]
Perl
Copy
use utf8;
@query=split '', 'ABC안녕123★';
print "$_, " for @query;
# A, B, C, 안, 녕, 1, 2, 3, ★,
Loading
4 PHP[ | ]

PHP
Copy
$str = 'ABC안녕123★';
$chs = mb_str_split($str);
foreach($chs as $ch) echo "$ch, ";
# A, B, C, 안, 녕, 1, 2, 3, ★,
Loading
5 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.