Home  >  Article  >  Java  >  What does split mean in Java?

What does split mean in Java?

藏色散人
藏色散人Original
2019-05-22 13:32:3213460browse

What does split mean in Java?

The meaning of split() in Java: Split a string into substrings, and then return the result as a string array.

split() methodSplits a string based on matching the given regular expression.

Note:

., | and * and other escape characters must be added with \\.

Multiple separators, you can use | as a hyphen.

Syntax

public String[] split(String regex, int limit)

Parameters

regex -- Regular expression delimiter.

limit -- The number of divided copies.

Return value

String array.

Related learning recommendations: java basic tutorial

The above is the detailed content of What does split mean in Java?. For more information, please follow other related articles on 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