28 lines
562 B
Objective-C
28 lines
562 B
Objective-C
//
|
|
// NSString+Customer.m
|
|
// Unity-iPhone
|
|
//
|
|
// Created by zhl on 2022/11/28.
|
|
//
|
|
|
|
#import "NSString+Customer.h"
|
|
|
|
@implementation NSString (Customer)
|
|
+ (BOOL)isStringEmpty:(NSString *)string {
|
|
if (((NSNull *) string == [NSNull null]) || (string == nil) ) {
|
|
return YES;
|
|
}
|
|
if (string == nil) {
|
|
return YES;
|
|
} else if ([string length] == 0) {
|
|
return YES;
|
|
}
|
|
string = [string stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
|
|
|
if ([string isEqualToString:@""]) {
|
|
return YES;
|
|
}
|
|
return NO;
|
|
}
|
|
@end
|