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是数组中 ...
随机推荐
- Forward和Redirect的区别
一:间接请求转发(Redirect) 二:直接请求转发(Forward) 用户向服务器发送了一次HTTP请求,该请求可能会经过多个信息资源处理以后才返回给用户,各个信息资源使用请求转发机制相互转发请求 ...
- select下拉框插件(转)
<!doctype html> <html> <head> <meta charset="UTF-8"> <title> ...
- session和cookie
第一次听到cookie这个词的时候着实兴奋了一段时间,以为是小饼干呢~快喝一杯82年的java压压惊!哈哈~ 与cookie的第一次邂逅——清缓存和清cookie 刚毕业的时候上班,做二次开发,明明后 ...
- 用C++画心(转)
原地址https://www.zhihu.com/topic/19613730/top-answers 首先上一个动态的心 代码如下: #include <stdio.h> #includ ...
- 我需要在Web上完成一个图片上传的功能(+2)
增加一个页面,用于判断传参是否正确. @{ //判断是否具备会员参数 if (UrlData.Count > 0) { Session["Arg ...
- python 学习1
安装环境 python(2.7.x)(64位) + django(1.9.7) + python-mysql(64位) 安装python时自带pip与easy_install,因此可用 pip ins ...
- TextMate 通用快捷键
原来一直在Windows上使用notepad++文本编辑器,现在换了MAC,发现notepad++ 官方没有MAC版本的,在MAC上使用也有办法,只不过实在是太麻烦了. 通过查看网友的建议,发现了Te ...
- 挂载windows共享文件夹
sudo mount -o username=用户名,password=密码 //本机IP/共享目录 ~/挂载目录
- 搭建Hadoop2.5.2+Eclipse开发调试环境
一.简介 为了开发调试方便,本文介绍在Eclipse下搭建开发环境,连接和提交任务到Hadoop集群. 二.安装前准备: 1)Eclipse:Luna 4.4.1 2)eclipse插件:hadoop ...
- idea安装