1234567891011121314151617181920212223242526272829 |
- //
- // NSString+YYAdd.m
- // Runner
- //
- // Created by apple on 2021/9/22.
- //
- #import "NSString+YYAdd.h"
- #import "NSData+YYAdd.h"
- @implementation NSString (YYAdd)
- - (NSData *)dataValue {
- return [self dataUsingEncoding:NSUTF8StringEncoding];
- }
- - (id)jsonValueDecoded {
- return [[self dataValue] jsonValueDecoded];
- }
- - (NSString *)toString :(id)id {
-
- if([id isKindOfClass:[NSString class]]){
- return id;
- }else if ([id isKindOfClass:[NSNumber class]]){
- return [id stringValue];
- }
- else {
- return @"";
- }
- }
- @end
|