如何将单词分解成其组成字母?
以下是一个代码示例,它不能正常工作
class Test {
public static void main( String[] args) {
String[] result = "Stack Me 123 Heppa1 oeu".split("\\a");
// output should be
// S
// t
// a
// c
// k
// M
// e
// H
// e
// ...
for ( int x=0; x<result.length; x++) {
System.out.println(result[x] + "\n");
}
}
}
问题似乎出在字符
\\a
上。
它应该是一个[A-Za-z]。