Ruby的一些基础知识

来源:互联网 发布:淘宝模特摄影 编辑:程序博客网 时间:2024/05/22 12:14

详细请点击:http://www.verydemo.com/demo_c119_i4514.html

C:\Users\hp>rubydef say_hello(name)  result="hello,"+name  return resultend#方法定义完成puts say_hello("lissdy")^Dhello,lissdy


first_hash={"name"=>"123456","pwd"=>"pwd123456","sex"=>"男","age"=>"32"}puts "属性数目:#{first_hash.size.to_s}"first_hash.each do |key,value|puts key.to_s+":"+value.to_send



0 0
原创粉丝点击