About 16,500,000 results
The string split() method breaks a given string around matches of the given regular expression. After splitting against the given regular expression, this method returns a string array.
Input String: 016-78967Regular Expression: -Output : {"016", "78967"}// Java program to demonstrate working of split(regex,// limit) with small limitpublic class GFG {// Main driver methodpublic static void main(String args[]){// Custom input stringString str = "geekss@for@geekss";String[] arrOfStr = str.split("@", 2);Content Under CC-BY-SA licenseJava split string to array Jan 18, 2013 java - How to split a comma-separated string? May 16, 2012 - People also ask