+ 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.

11th Jan 2020, 4:20 AM
Sam Harford
Sam Harford - avatar
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
18th Jan 2020, 12:45 PM
Owen Ho
Owen Ho - avatar
+ 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
11th Jan 2020, 4:34 AM
Arsenic
Arsenic - avatar
+ 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
12th Jan 2020, 1:16 AM
Arsenic
Arsenic - avatar
+ 1
Arsenic But it was ruby, and i thought you could put anything in the "". the code was like this: . . . . puts "|\ /|"
11th Jan 2020, 8:35 PM
Sam Harford
Sam Harford - avatar
0
Owen Ho Thank you so much!
19th Jan 2020, 11:25 PM
Sam Harford
Sam Harford - avatar