- (NSString*)smartURLForString:(NSString*)str
{
NSString*result =@"0";
NSString*trimmedStr;
NSRangeschemeMarkerRange;
//取出目标字符串前后空格和特殊字符
trimmedStr = [strstringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if((trimmedStr !=nil) && (trimmedStr.length!=0)) {
schemeMarkerRange = [trimmedStrrangeOfString:@"://"];
if(schemeMarkerRange.length>0) {
result = trimmedStr;
}
else{
result =@"0";
}
}
returnresult;
}
网友评论