if(resultStr.indexOf("commonsetsession.aspx")>0){
if(originalResultStr.indexOf("?")<0)
{
originalResultStr += "?" + deviceToken;
} else {
originalResultStr += "&" + deviceToken;
}
}
java中是這樣寫的 ,求大神幫忙看看 IOS中怎麼寫。。。。。。急
NSString *dealString,*deviceToKen;
if ([dealString rangeOfString:@"?"].location == NSNotFound) {
dealString = [NSString stringWithFormat:@"%@?%@",dealString,deviceToKen];
} else {
dealString = [NSString stringWithFormat:@"%@&%@",dealString,deviceToKen];;
}