+ 1
Why does the app not show backslashes?
I was making a code and i made an M out of punctuation, look at the code then the output. (Ruby) https://code.sololearn.com/cwEvtX130Xuc/?ref=app I have a suggestion. Make backslashes possible to use.
5 Answers
+ 1
This is what you need to do to make backslash appear: \\
I have corrected it for you and saved it as correction for thesam
https://code.sololearn.com/cr9O5cOe9d1e/#rb
+ 3
Sam Harford, this is because backslash and other characters like double quotes, single quotes etc. Can be often confused by th system at the time of compilation so we can use them using escape character(that is \ itself)
So inorder to use non-graphic characters like spaces and tabs we have to use backslash to specify it (like \n for newline)
So in order to print backslash on the screen just put 2 backslashes(one to tell that other one is an escape sequence and other one to print)
Go here for more informationđ
https://en.wikibooks.org/wiki/Ruby_Programming/Strings
+ 2
Sam Harford , in Ruby also you can't put anything between " ", just try putting a single " in your program and it will confuse the system and generate an errorđ
https://code.sololearn.com/c9URi56ITJ0s/?ref=app
+ 1
Arsenic But it was ruby, and i thought you could put anything in the "".
the code was like this:
.
.
.
.
puts "|\ /|"
0
Owen Ho Thank you so much!