Home »
VB.Net »
VB.Net Programs
VB.Net program to print backslash (\) character on the console screen
Here, we are going to learn how to print backslash (\) character on the console screen in VB.Net?
Submitted by Nidhi, on November 26, 2020
We will create a program in VB.Net to print backslash (\) character using a double backslash "\\" character on the console screen.
Program/Source Code:
The source code to print backslash (\) character on the console screen is given below. The given program is compiled and executed successfully.
'VB.Net program to print backslash (\) character
'on the console screen.
Module Module1
Sub Main()
'printing "\"
Console.WriteLine("\\")
'printing between the string "\"
Console.WriteLine("Hello\\World")
'printing "\"n and "\"t
Console.WriteLine("\\n\\t")
'hit ENTER to exit the program
Console.ReadLine()
End Sub
End Module
Output:
\\
Hello\\World
\\n\\t
Explanation:
In the above program, we created a Module that contains the Main() method, here we used the WriteLine() method of Console class to print the message on the console screen. Here, we used double backslash "\\" to print backslash character on the console screen.
TOP Interview Coding Problems/Challenges