Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 5 and Version 6 of EscapeSequencesExample

Show
Ignore:
Author:
nascent (IP: 67.110.217.136)
Timestamp:
05/30/10 20:14:50 (14 years ago)
Comment:

Updated to be version agnostic.

Legend:

Unmodified
Added
Removed
Modified
  • EscapeSequencesExample

    v5 v6  
    1616import std.stdio; 
    1717 
    18 const char[] backslashWYSIWYG = `\`; 
    19 const char[] quoteWYSIWYG = `'`; 
    20 const char[] doubleQuoteWYSIWYG = `"`; 
     18const string backslashWYSIWYG = `\`; 
     19const string quoteWYSIWYG = `'`; 
     20const string doubleQuoteWYSIWYG = `"`; 
    2121 
    22 const char[] doubleQuoteReg = "\""; 
    23 const char[] quoteReg = "\'"; 
    24 const char[] backslashReg = "\\"; 
     22const string doubleQuoteReg = "\""; 
     23const string quoteReg = "\'"; 
     24const string backslashReg = "\\"; 
    2525 
    2626const char quoteChar = '\''; 
    3030void main() 
    3131{ 
    32     writef(cast(char[]) (doubleQuoteReg ~ "That's what I said!" ~ doubleQuoteReg ~ \n\0));   
     32    writefln(doubleQuoteReg ~ "That's what I said!" ~ doubleQuoteReg);   
    3333} 
    3434}}} 
    3939|| Author || jcc7 || 
    4040 
    41 == Caveat == 
    42  
    43 This main part of this program can be simplified: 
    44  
    45 {{{ 
    46 #!d 
    47 void main() 
    48 { 
    49     writefln(doubleQuoteReg ~ "That's what I said!" ~ doubleQuoteReg);   
    50 } 
    51 }}}