Home  >  Article  >  Java  >  Example of using java's split method

Example of using java's split method

高洛峰
高洛峰Original
2017-01-18 15:41:091440browse

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]);
  }
 }
}

The running result is:

Example of using javas split method

For more java split method usage examples and related articles, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn