How to check if a string contains a substring containing spaces?

前端 未结 6 1782
一个人的身影
一个人的身影 2020-12-18 12:26

Say I have a string like this in java:

\"this is {my string: } ok\"

Note, there can be any number of white spaces in between the various characters. How do I

6条回答
  •  眼角桃花
    2020-12-18 13:25

    Put it all into a string variable, say s, then do s.contains("{my string: }); this will return true if {my string: } is in s.

提交回复
热议问题