Home »
VB.Net »
VB.Net Programs
VB.Net program to print backslash (\) character on the console screen
By Nidhi Last Updated : November 16, 2024
Printing backslash (\) character
We will create a program in VB.Net to print backslash (\) character using a double backslash "\\" character on the console screen.
VB.Net code to print backslash (\) character on the console screen
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.
VB.Net Basic Programs »