split() String Example

split() String Example

java.lang.String class comes with overloaded split() String method to split a string into tokens. Introduced in JDK 1.4, earlier done with SringTokenizerr.

The signature of split() String Example is given as defined in Java API.

  • public String[] split(String regex): Returns an array of string words after splitting the string into words. Introduces with JDK 1.4.
In the following example, split() String Example is used to split string str1. Original string str1 is not disturbed.


split() String Example
Output screenshot on split() String Example

Pass your comments and suggestion on this tutorial "split() String Example".

Leave a Reply

Your email address will not be published. Required fields are marked *