为了账号安全,请及时绑定邮箱和手机立即绑定

请问该如何在Ruby中使用字符串方法?

请问该如何在Ruby中使用字符串方法?

ibeautiful 2019-10-21 15:13:10
如何在Ruby中使用字符串方法
查看完整描述

4 回答

?
慕田峪7331174

TA贡献1828条经验 获得超13个赞

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

查看完整回答
反对 回复 2019-10-26
  • 4 回答
  • 0 关注
  • 755 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信