Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@yaoTrubine
Member
NO. 29997 / 2016-12-30

[email protected]
上海
0 Topics / 2 Replies
0 Followers
1 Following
27 Favorites
GitHub Public Repos
More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 分享下一点创业小心得以及创业项目运营情况 at October 12, 2017

    不接广告么

  • Ruby 操作修改文件内容 at January 26, 2017

    写两个方法辣

    #第一个 
    def output(filename)
        str = ""
        File.open(filename,"r+"){|f|
              f.each_line{|line|
                   str += line.gsub(/,/,"\n")
              }
        }
       str
    end
    result = output("example.txt")
    
    #第二个
    def input(filename,str)
        File.open(filename,"w"){|f|
            f.write str
    }
    end
    input("example.txt",result)
    
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English