How to check string contains special character in ruby

前端 未结 7 1699
我在风中等你
我在风中等你 2021-02-12 22:31

How to check whether a string contains special character in ruby. If I get regular expression also it is fine.

Please let me know

7条回答
  •  悲哀的现实
    2021-02-12 23:19

    Why not use inverse of [:alnum:] posix.

    Here [:alnum:] includes all 0-9, a-z, A-Z.

    Read more here.

提交回复
热议问题