Format a string using regex in Java

前端 未结 6 1368
执笔经年
执笔经年 2020-12-14 11:16

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

6条回答
  •  执笔经年
    2020-12-14 11:43

    I would use a combination of java String.format() method and String.substring()

提交回复
热议问题