A
Al Cholic
Hello,
Im working with regular expressions and I cant quite understand how the
"13" is extracted from the string.
Here is the irb output:
irb(main):005:0> "(13)"[1..-2].to_i
=> 13
I dont understadn how the [1..-2] parameter removes the parenthases from
the string.
Could someone please explain.
Thanks in advance.
Im working with regular expressions and I cant quite understand how the
"13" is extracted from the string.
Here is the irb output:
irb(main):005:0> "(13)"[1..-2].to_i
=> 13
I dont understadn how the [1..-2] parameter removes the parenthases from
the string.
Could someone please explain.
Thanks in advance.