Ruby-1
- Ruby API 文档 http://www.ruby-doc.org/core-2.0.0/
- Programming Ruby http://ishare.iask.sina.com.cn/f/22783772.html
- 替换字符串某一部分的方法
puts "hello".sub(/l/, '*')
puts "hello".gsub(/l/, '*') puts "hello".sub(/lll/, '*')
puts "hello".gsub(/lll/, '*') #return itself if no gsub
puts "hello".sub!(/lll/, '*')
puts "hello".gsub!(/lll/, '*') #return nil if no gsub
sleep 10 - 正则表达式 http://www.ruby-doc.org/core-2.0.0/Regexp.html
- Regexps are created using the
/.../and%r{...}literals, and by theRegexp::newconstructor.
- Regexps are created using the
- 区间 http://www.ruby-doc.org/core-2.0.0/Range.html
- Ranges may be constructed using the s
..e and s...e literals, or with ::new.
- Ranges may be constructed using the s
- 打印字符串
puts "hello"
Ruby-1的更多相关文章
- 安装cocoapods遇到两大坑-Ruby版本升级和Podfile的配置
今天安装cocoapods #移除原有ruby源 $ gem sources --remove https://rubygems.org/ #使用可用的淘宝网 $ gem sources -a htt ...
- Unable to download data from http://ruby.taobao.org/ & don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
安装cocoapods,记录两个问题! 1.镜像已经替换成了 http://ruby.taobao.org/, 还是不能不能安装cocoapods, 报错:Unable to download dat ...
- 安装了ruby后怎么安装sass
在命令行中输入 ruby -v 查看版本号 先移除默认的https://rubygems.org源,命令为gem sources --remove https://rubygems.org/,按回车 ...
- ruby 基础知识(一)
突然今天发现一大神的博客:http://www.cnblogs.com/jackluo/archive/2013/01/22/2871655.html 相信初学者会受益颇多 ruby 参考文档 ...
- ruby 基础知识(二)
ruby 中的动态方法 http://singleant.iteye.com/blog/1680382 Rails 大量使用了符号(symbol).符号看上去很像变量名,不过以冒号作为前缀.符号的例 ...
- Ruby安装Scss
Ruby安装Scss 引言 已经许久不写HTML了,今天有点以前的东西要改.但是刚装的Windows10,已经没有以前的Web开发环境了.只好重新安装. 结果Webstorm装好后配置Scss出现错误 ...
- fzf by ruby
fzf by ruby */--> fzf by ruby 1 github地址 https://github.com/junegunn/fzf 2 简介 软件通过匿名管道和grep扩展了bas ...
- The Safe Navigation Operator (&.) in Ruby
The most interesting addition to Ruby 2.3.0 is the Safe Navigation Operator(&.). A similar opera ...
- Ruby on Rails 创建https应用
1. 创建证书请求文件条件:私钥+证书签名请求+opensslyum install -y opensslmkdir /root/ssl/ && cd /root/ssl/openss ...
- Ruby数组
Ruby数组是有序的,任何对象的整数索引的集合.每个数组中的元素相关联,并提取到的一个索引.下标与C或Java相似,从0开始.负数索引假设数组末尾,也就是说-1表示最后一个元素的数组索引,-2是数组中 ...
随机推荐
- ExtJS自制表格Grid分页条
试过Grid自带的load和分页功能,没有成功,干脆就自己写了...... 主要是查询条件比较复杂...... 希望哪位大神能有更好的意见. Ext.define('MyApp.ux.Paginati ...
- 用原生js获取class
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- (48) odoo的button用法
button 应用的比较多,这里来汇总一下 按钮<button>,支持的属性 icon 可用的icon在 addons/web/static/src/img/icons ...
- fiddler监听127.0.0.1或localhost
localhost/127.0.0.1的请求不会通过任何代理发送,fiddler也就无法截获. 解决方案 1,用 http://localhost. (locahost紧跟一个点号)2,用 http: ...
- Java Js实现导出csv
$.ajax({ type: 'GET', async: false, url: '../../api/screening/exportTable?seriesIndex=' + param.seri ...
- uva 10817(状压dp)
题意:就是有个学校要招老师.要让没门课至少有两个老师可以上.每个样样例先输入三个数字课程数量s,已经在任的老师数量,和应聘的老师数量.已经在任的一定要聘请. 思路是参考了刘汝佳书上的,关键如何状压. ...
- canvas绘图
1.//获取canvas容器var can = document.getElementById('canvas');//创建一个画布var ctx = can.getContext('2d');2.绘 ...
- python二进制相关
https://docs.python.org/3/library/struct.html#module-struct
- Sublime Text 2 配置(转载)
转载 自 Sublime Text 2 的详细配置(C++) 想起暑假在公司偷偷写题,用不惯vs ,配sublime 又一直编译不了...每次用codeblocks 眼泪掉下来www 下载sublim ...
- docker index服务概述
index顾名思义“索引”,index服务主要提供镜像索引以及用户认证的功能.当下载一个镜像的时候,首先会去index服务上 做认证,然后查找镜像所在的registry的地址并放回给docker客户端 ...