Ruby Regexp using gsub is there an equivalent to self keyword?
来源:互联网 发布:最美的句子知乎 编辑:程序博客网 时间:2024/05/17 06:14
String#gsub
accepts an optional block. The return value of the block is used as a replacement string.
str.gsub(/[a-z]/) { |x| x.next }# => "bcd123"
Shorter version using &:next
syntax:
str.gsub(/[a-z]/, &:next)# => "bcd123"
0 0
- Ruby Regexp using gsub is there an equivalent to self keyword?
- How to gsub \ in ruby array?
- Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning
- Is there a way to add a badge to an application icon in Android?
- ruby中gsub和gsub!的区别
- Is there a limit to the number of columns in an HBase row?
- Is-there-any-way-to-prevent-an-android-app-from-being-removed
- There was an internal error, and Internet Explorer is unable to print this document
- Using SAPI is there a way to enter pinyin for Chinese pronunciation
- Is there a way to loop through a table variable in TSQL without using a cursor?
- Is there an XML version of HTML?
- config the gitweb there is an error
- using an enumerable built-in Ruby to access and manipulate nested data
- 解决YouCompleteMe"encoding" is an invalid keyword 错误
- What is the C# equivalent to C++ OutputDebugString?
- Q4.2 Given a directed graph, design an algorithm to find out whether there is a route.
- Does Ruby have a method similar to Emacs align-regexp?
- unable to start the monitor on 4454 ,an other instance is problaly using the same port
- Block高级用法(传值)
- java学习笔记(4)
- 创建你第一个SharePoint 2010 应用程序----完整推荐总结
- jqm视频播放器,html5视频播放器,html5音乐播放器,html5播放器,video开发demo,html5视频播放示例,html5手机视频播放器
- A
- Ruby Regexp using gsub is there an equivalent to self keyword?
- SVN update Failed . Locked
- Beginning Python Chapter 27
- cocos2dx挖掘
- IntelliJ IDEA 代码提示的问题
- 判断大端或小端
- 读mybatis源码之二:构建SqlSession逻辑
- 有用的开源库支持
- 三分搜索——初见