Split Demo using RegularExpression
This Example describe the way to Split a String using Regularexpression. The steps involved in splitting a String are described below:-String text = "For some college -Presidents want law-revisited saying age limit-has not curbed-that problems on campuses":-This is the String to which we are splitting.
String Splitpoint = "-":-Point where the string is to be splitted.
SplitString.java
import java.util.*;
|
Output of the program:-
==========STRING BEFORE SPLITTING IS:========== For some college -Presidents want law-revisited saying age limit-has not curbed-that problems on campuses ==========SPLITTED STRING IS:========== For some college Presidents want law revisited saying age limit has not curbed that problems on campuses ======================================== |
Download Source Code