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

请问该如何在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 关注
  • 835 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号