包含Java引号 [英] contains quotation mark java
本文介绍了包含Java引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何添加参数以检查字符串是否包含一个引号?我试图逃脱角色,但不起作用
how to I add an argument to check if a string contains ONE quotation mark ? I tried to escape the character but it doesn't work
words[i].contains()
我不好,有一些未封闭的括号,现在可以正常使用
my bad, got some unclosed brackets, works fine now
推荐答案
words[i].matches("[^\"]*\"[^\"]*")
也就是说:任何非引号,一个引号,任何非引号.
That is: any non-quotes, a quote, any non-quotes.
这篇关于包含Java引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文