打印

[问题求助] string 匹配

string 匹配

strA = "new" strB="up"  strC =""
strC 的值是自己输入的值
要求: 当strC = strA 或者 strB中包含的字符 不区分大小写
eg:
strC ="n" 满足 
strC ="ne" 满足
strC ="up" 满足
strC ="np" 不满足

TOP

if strA.include?(t.downcase) or strB.include?(t.downcase)
 puts "ok"
else
 puts "no exist!"
end

TOP

3KS

谢谢!!

TOP

学习了...

TOP

2008-11-23 22:05 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html) @38.103.63.61