digitalmars.D - Where the error ? (!=) (<>)
- sdvcn (23/23) Apr 13 2014 dstring key = "<"d;
- sdvcn (2/25) Apr 13 2014 I made a mistake should be
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/5) Apr 13 2014 Your message is truncated. Can you repost it to the D.learn newsgroup
dstring key = "<"d; dstring str = "<盗墓笔记>"d; for(size_t i;i<str.length;) { bool bh = true; foreach(dchar kv;key) { dchar t = cast(dchar)tstr[i++]; // 0x3c dchar ta = 0x3c; //if(str[i++] != kv) //kv : 0x3c //if(t == ta) // Should return true //if(t <> ta) // Should return false if(t != ta) // Should return false { // All returns true ?????**** bh = false; i += key.length; break; }; } } "if(t <> ta)" No right to judge "if(t != ta)" No right to judge
Apr 13 2014
On Monday, 14 April 2014 at 02:38:17 UTC, sdvcn wrote:dstring key = "<"d; dstring str = "<盗墓笔记>"d; for(size_t i;i<str.length;) { bool bh = true; foreach(dchar kv;key) { dchar t = cast(dchar)tstr[i++]; // 0x3c dchar ta = 0x3c; //if(str[i++] != kv) //kv : 0x3c //if(t == ta) // Should return true //if(t <> ta) // Should return false if(t != ta) // Should return false { // All returns true ?????**** bh = false; i += key.length; break; }; } } "if(t <> ta)" No right to judge "if(t != ta)" No right to judgeI made a mistake should be
Apr 13 2014
On 04/13/2014 08:21 PM, sdvcn wrote:I made a mistake should beYour message is truncated. Can you repost it to the D.learn newsgroup please. Ali
Apr 13 2014