Is there any way I can format a string into a specific pattern using regex or is stringbuilder + substring a faster approach?
For example, say a phone number --> 123
I would use a combination of java String.format() method and String.substring()
String.format()
String.substring()