Advertisement
VyaraG

QuotesInStrings

Nov 28th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. //Declare two string variables and assign them with following value:
  3. //The "use" of quotations causes difficulties.
  4. //Do the above in two different ways: with and without using quoted strings. Print the variables to ensure that their value was correctly defined.
  5.  
  6.  
  7.     class QuotesInStrings
  8.     {
  9.         static void Main()
  10.         {
  11.             string withQuotedStrings = @"The ""use"" of quotations causes difficulties.";
  12.             string withoutQuotedStrings = "The \"use\" of quotations causes difficulties.";
  13.             Console.WriteLine(withQuotedStrings);
  14.             Console.WriteLine(withoutQuotedStrings);
  15.  
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement