Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种简单的方法可以在查询中调用类似于数据库的东西?
["string1","mystring","string2"] 中是否存在“mystring” => 将返回 true
["string1","string2","string3"] 中是否存在“mystring” => 将返回 false
["string1","mystring","string2"].include? "mystring"
请参阅:可枚举#include?