//
//  NSURL+DDCategory.m
//  DDCategoryKit_Private
//  Created by DDIsFriend on 2023/2/6.

#import "NSURL+DDCategory.h"

@implementation NSURL (DDCategory)
+ (NSURL *)encodingUrlString:(NSString *)urlString withAllowedCharactersString:(nullable NSString *)allowedCharactersString{
    if (allowedCharactersString == nil) {
        allowedCharactersString = @"\"#%<>[\\]^`{|}";
    }
    return [self URLWithString:[urlString stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:allowedCharactersString] invertedSet]]];
}
@end
