What is verbatim string? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is verbatim string?

What is the meaning of verbatim string and what is the usage?

13th Feb 2017, 5:53 AM
Shahid Saddique
Shahid Saddique - avatar
2 Answers
+ 3
string str = @"c:\documents and settings\"; This way you don't need to escape the backslash characters. It takes the string literally verbatim. Very common when using for file paths, urls etc. see here: https://goo.gl/04mVAR
13th Feb 2017, 6:15 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Thanks @Chaotic
13th Feb 2017, 8:49 AM
Shahid Saddique
Shahid Saddique - avatar