Putting quotes in wysiwyg strings

Hasan Aljudy hasan.aljudy at gmail.com
Wed Nov 22 16:50:03 PST 2006



John S. Skogtvedt wrote:
> Lionello Lunesu skrev:
>> Oh, by the way:
>>
>> "
>>     if (k & e.Shift) { ret ~= ""Shift""; }
>>     if (k & e.Ctrl)  { if (ret) ret~=""|""; ret ~= ""Ctrl""; }
>>     if (k & e.Alt)   { if (ret) ret~=""|""; ret ~= ""Alt""; }
>>     if (!ret) ret = ""None"";
>> "
>>
>> ;)
> In python one can use:
> 
> r'''if (k & e.Shift) { ret ~= "Shift"; }
> if (k & e.Ctrl)  { if (ret) ret~="|"; ret ~= "Ctrl"; }
> if (k & e.Alt)   { if (ret) ret~="|"; ret ~= "Alt"; }
> if (!ret) ret = "None"'''
> 
> or:
> 
> r"""if (k & e.Shift) { ret ~= "Shift"; }
> if (k & e.Ctrl)  { if (ret) ret~="|"; ret ~= "Ctrl"; }
> if (k & e.Alt)   { if (ret) ret~="|"; ret ~= "Alt"; }
> if (!ret) ret = "None\""""

but if D has ''' or """ the problem will still manifest in the same way!!

counter example code:
auto x = """hey!''""";
auto y = '''yo!''';
//did you think you can use ` to do this?
auto z = """ oi ` oi """;




More information about the Digitalmars-d mailing list