ruby预先定义变数(Pre-defined Variable)

预先定义变数(Pre-defined Variable)

与异常相关:

$! raise设定的异常资讯讯息。
$@ 最近被掷出之异常的追踪资讯阵列。
与最近字样比对动作相关:

$& 符合字样之内容。
$` 符合字样之字串左侧的内容。
$' 符合字样之字串右侧的内容。
$+ 符合最后一个字样分组的内容。
$1 to $9 符合第1 到9 个字样分组的内容。
$~ 比对动作相关资讯。
$= The flag for case insensitive, nil by default.
$/ The input record separator, newline by default.
$\ The output record separator for the print and IO#write. Default is nil.
$, The output field separator for the print and Array#join.
$; The default separator for String#split.
$. The current input line number of the last file that was read.
$< The virtual concatenation file of the files given on command line.
$> The default output for print, printf. $stdout by default.
$_ The last input line of string by gets or readline.
$0 手稿程式的名称。可指派。
$*命令列引数阵列,即ARGV。
$$ 运行手稿程式的Ruby 行程识别码(PID)。
$? 最后执行的子行程之状态码。
$: 载入(load or require)手稿程式档案或模组时之搜寻路径的阵列。
$"以require载入的模组名称之阵列。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值