Swift how to compare string which come from NSString
问题 I get a return number(0 for success, 1 for failure) form sever made by php so I want get this number to judge my operation succeeded or not. I use this : var str1 :String = NSString(data: d, encoding: NSUTF8StringEncoding)! let str2 = "1" println(str1) // output is 1 println(str2) // output is 1 if(str1==str2){println("same")} //but the two is not same so I debug for this and I get this result: //str1 _countAndFlags UWord 13835058055282163717 -4611686018427387899 //str2 _countAndFlags UWord 1