Verify if String matches a format String

前端 未结 7 1787
旧巷少年郎
旧巷少年郎 2021-02-13 09:15

In Java, how can you determine if a String matches a format string (ie: song%03d.mp3)?

In other words, how would you implement the following function?

7条回答
  •  悲哀的现实
    2021-02-13 09:46

    You can use the Pattern class to implement the method to do what you want. Take a look at the examples in the Pattern Java api page.

提交回复
热议问题