Is there support in Ruby for (for lack of a better word) non-escaped (verbatim) strings?
Like in C#:
@"c:\Program Files\"
...or in Tcl:
{c:\Program Files\}
To display a string in your program, you can use the print method: print "Let's print out this string." The print method displays the string exactly as written. print 'This is the first string.
Creating Strings: To create the string, just put the sequence of characters either in double quotes or single quotes. Also, the user can store the string into some variable. In Ruby, there is no need to specify the data type of the variable.
Yes, you need to prefix your string with %
and then a single character delineating its type.
The one you want is %q{c:\program files\}
.
The pickaxe book covers this nicely here, section is General Delimited Input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With