Putting quotes in wysiwyg strings

John S. Skogtvedt jss2k2 at chello.no
Thu Nov 23 00:44:38 PST 2006


Hasan Aljudy skrev:
> 
> 
> 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 """;
> 
Why? The following works in D:
auto z = " oi ` oi ";




More information about the Digitalmars-d mailing list