[Rails] regular special character replacement

Regular replacement of special characters

[:punct:] Special symbols (all punctuation)

Applications in Ruby

# 将所有的标点符号替换掉
"这里是字符串  ".gsub(/[[:punct:]]/, '')

Guess you like

Origin blog.csdn.net/m0_46537958/article/details/108381054
Recommended