易截截图软件、单文件、免安装、纯绿色、仅160KB

ruby好像有指针啊!!!

b = "123"
a = b
b.gsub!(/2/,"")
puts a
得到的结果是13,发现如果a = b的话貌似只是把b的指针给了a,但是如果b的值发生了变化a才能从b中独立出来。
如果把上面的代码改成
b = "123"
a = "#{b}"
b.gsub!(/2/,"")
puts a
则得到的结果为123,这里是把b的值给了a
不知道我的猜想对不对!


相关文档:

Ruby 一步步安装


http://www.gayathri-frenzy.com/technology/ruby-on-rails
I kept thinking for a while on what do I have next in the store
Here we go “Ruby on Rails”
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby Programming language.Ruby is a ......

Ruby学习笔记一——语言基础


#一、这里是注释,是单行注释,类似于//
puts 3/5#这里是整数形式的结果
puts 3/5.0#这里是小数形式的结果
=begin
  这是多行注释,实际上这也是Ruby内嵌文档格式,类似于Java doc
  =end不但要有起止,还要缩进才有用。
=end
#二、连行
puts "Hello Ruby!"; puts "This is a "\
"String";# ......

转载——Ruby字符串处理

转自:http://developer.51cto.com/art/200912/170762.htm 
Ruby字符串处理函数总结列表分享
Ruby字符串处理函数包括返回字符串长度函数;判断字符串中是否包含另一个串函数;字符串插入;字符串分隔,默认分隔符为空格等等。
 
str.length => integer 
str.include? other_str
&nbs ......

Fix Thrift 0.2.0 Installation with Ruby 1.9.1

When I try the command "gem install thrift" with Ruby 1.9.1, I got a compilation error with something related to a C function "strlcpy()".
Then I searched the web. It seems I am not alone and the community know it.
However I do not want to wait for official update, I want to ......

ruby命令行解析

   可用库:getoptlong.rs, optionparser
   对应类:GetoptLong,  OptionParser
   前者已过时,建议使用后者,且后者比前者易用。
后者特点:
1. 参数描述和代码处理写在一起
2. 输出参数说明,不需单独维护
3. 可选参数和命令参数描述简洁
4. 参数可自动转换为特定的类
5. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号