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

Example of using java's split method

高洛峰
Release: 2017-01-18 15:41:09
Original
1509 people have browsed it

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template