Hi Im a beginner in programming C# while watching this tutorial on C# (writing a console application) the guy skipped over a couple segments in between parts of code.

Where he was doing "if" statements of " if (input3 == "n" (vertical lines here) input3 == "n").

Im wondering how was he able to type that is that a feature in visual studio? What keystroke is it? The significance and what does it mean..


Attachments C#_question_vertical_lines.PNG 33.72 KB
6 Years
Discussion Span
Last Post by techlawsam

what about for american english keyboards? What is the use for that symbol?


It's the character that is the shifted \ key = |

|| means "or" with the properties that if the part on the left of the || is true, the part on the right of the || is never evaluated (known as short circuiting). This can be done because in the logic true table for "or" if one side is true then the result is true. It speeds up evaluation a slight bit.

Edited by Momerath: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.