I am trying to split an inputted number such as (123) 456-7890.
String [] split = s.split(delimiters);
I have been searching the web for ways of delimiting the area code inside the set of the parentheses but I haven't found anything that works for my case. I do not know if the array is messing up with it printing either. The array is not required but I did not know what else to do since it is required to use the split method.
(123, so then you doSystem.out.println("(" + NumberTokens[0] + ")")you get two braces. Either add(to delimeters and start from element 1 or just print without"("System.out.println("123) 456-7890".replaceAll("\\D", ""));