如何在Ruby中使用字符串方法
請問該如何在Ruby中使用字符串方法?
ibeautiful
2019-10-21 15:13:10
TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超13個(gè)贊
c中是strstr.
ruby 1.9.3中包含:
include? other_str → true or false click to toggle source
Returns true if str contains the given string or character.
"hello".include? "lo" #=> true
"hello".include? "ol" #=> false
"hello".include? ?h #=> true
舉報(bào)