Ruby predefined read-only variable

本文详细介绍了Ruby语言中的一系列特殊变量及其用途,包括错误信息、正则表达式匹配结果等重要概念,对于理解和使用Ruby进行高效编程具有重要作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在這個網址下有個List
http://www.math.hokudai.ac.jp/~gotoken/ruby/ruby-uguide/uguide20.html

$! error message
$@ position of an error occurrence
$_ latest read string by `gets'
$. latest read number of line by interpreter
$& latest matched string by the regexep.
$1, $2... latest matched string by nth parentheses of regexp.
$~ data for latest matche for regexp
$= whether or not case-sensitive in string matching
$/ input record separator
$\ output record separator
$0 the name of the ruby scpript file
$* command line arguments for the ruby scpript
$$ PID for ruby interpreter
$? status of the latest executed child process

順手補上一個...
$: 會印出Ruby Path
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值