Check if string ends with certain pattern

后端 未结 5 1876
予麋鹿
予麋鹿 2020-12-03 00:11

If I have a string like:

This.is.a.great.place.too.work.

or:

This/is/a/great/place/too/work/

than my prog

5条回答
  •  感动是毒
    2020-12-03 00:51

    Of course you can use the StringTokenizer class to split the String with '.' or '/', and check if the last word is "work".

提交回复
热议问题