Friday, 4 April 2014

check For http:// in URL String and return proper URL String

+(NSString *)checkForHttp:(NSString *)emailString
{
    
    NSString *newEmailString = [NSString stringWithFormat:@"%@",emailString];
    
    
    BOOL result = [[emailString lowercaseString] hasPrefix:@"http://"];
    
    if (!result)
        newEmailString = [NSString stringWithFormat:@"http://%@",emailString];
    
    
    return newEmailString;
}

No comments:

Post a Comment