(i) is regular string literal; it consists of zero or more characters enclosed in double quotes (i.e: "yo!")
(ii) is a verbatim string literal; it consists of an @ character followed by a double-quote character, zero or more characters, and a closing double-quote character (i.e: @"yo!")
the "yo" was a bad example, but consider you want to print a double quote in your string like this: yo"
you can't do it with regular string literal because the double quote will treat as "closing double-quote".
in order to print: yo", you need to:
@"yo"""
detail is here
"Java is great, PHP sucks and .NET can't scale" - Shaun Connoly, JBoss's vice president of product development. April 5, 2006
Bookmarks