代码如下:
package com.lihua.test;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
String str = "abcdefghij";
String array[] = str.split("");
for (int i = 1; i < array.length; i++) {
System.out.println(i + "-->" + array[i]);
}
}
}
运行结果为: