Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
crayygy
@crayygy
Member
NO. 19421 / 2015-06-16

上海
2 Topics / 4 Replies
0 Followers
0 Following
1 Favorites
GitHub Public Repos
More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • [Problem, Ruby, Array] 如何检测一个字符串中包括某个数组中的元素? at May 25, 2016

    #13 楼 @suffering 我想了一个方法,能麻烦帮忙看下有没有什么问题吗?

    keywords.each do |keyword|
      if line.include? keyword
          # do_something
          break
      end
    end
    
  • [Problem, Ruby, Array] 如何检测一个字符串中包括某个数组中的元素? at May 25, 2016

    #9 楼 @zfjoy520 学习了!刚刚接触 Ruby 不久,感觉要学习的地方还很多呀

  • [Problem, Ruby, Array] 如何检测一个字符串中包括某个数组中的元素? at May 24, 2016

    #2 楼 @AlexShawn 谢谢!这个思路感觉挺独特的,测试了一下,10w 行数据耗时有点长,最后出来的数据也有点小问题。可能是我哪里写错了?

  • [Problem, Ruby, Array] 如何检测一个字符串中包括某个数组中的元素? at May 24, 2016

    #1 楼 @hooopo 谢谢!感觉很有用,我再继续研究一下!

关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English