Ruby#@转义序列是什么意思?

时间:2019-07-19 14:45:20

标签: ruby

有人可以解释这种Ruby行为吗?我在文档中找不到关于此序列的任何提及,也许我不知道在哪里看。

> var = "qw#@er"
 => "qw"
> var = 'qw#@er'
 => "qw\#@er"
> var = "qw#@@er"
NameError: uninitialized class variable @@er in Object
    from (irb):17:in `evaluate'
    from org/jruby/RubyKernel.java:1079:in `eval'
    from org/jruby/RubyKernel.java:1479:in `loop'
    from org/jruby/RubyKernel.java:1242:in `catch'
    from org/jruby/RubyKernel.java:1242:in `catch'

0 个答案:

没有答案