I am trying to have the desired outputs like this:
555
555
5555
by using codes:
public class Split {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String phoneNumber = "(555) 555-5555";
String[] splitNumberParts = phoneNumber.split(" |-");
for(String part : splitNumberParts)
System.out.println(part);
But dont know how to get rid of the "( )" from the first element.
Thanks in advance.
Regards