Files
peko-ios/YuMi/Tools/NSString/NSString+Utils.h

65 lines
1.5 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// NSString+Regex.h
// YUMI
//
// Created by YUMI on 2021/9/14.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (Utils)
///是否是正确的手机号
- (BOOL)isPhoneNumber;
///MD5加密
- (NSString *)MD5String;
+ (BOOL)versionCompareOldStr:(NSString *)first andNewStr: (NSString *)second;
///数字转化为万
+ (NSString *)getDealNumWithString:(NSString *)string;
///数字转化为十万
+(NSString *)getDealTenNumWithString:(NSString *)string;
+ (NSString *)formatNumberToKOrM:(NSString *)string;
///时间戳转化为需要显示的内容
+ (NSString *)stringWithTimeStamp:(NSString *)timeStamp;
///通过生日获取星座
+ (NSString *)calculateConstellationWithMonth:(long)time;
///通过生日获取星座
+ (NSString *)getCalculateConstellationTextWithMonth:(long)time;
///通过生日获取星座图片
+ (NSString *)getCalculateConstellationImageWithMonth:(long)time;
///得到年龄
+(NSString *)getAgeWithBirth:(long)birth;
///得到区号
+(NSString *)getCountryCode;
///产生唯一的key用于图片或文件上传
+ (NSString *)createUUID;
+ (BOOL)isEmpty:(NSString *)string;
//- (BOOL)isEmpty;
- (NSString *)pureURLString;
+ (NSString *)formatNumberToKOrM_NoRounding:(NSString *)string;
+ (NSString *)stringByRemovingRedundantZeros:(NSString *)string;
+ (NSString *)trimString:(NSString *)input lengthLimit:(NSInteger)limit;
+ (BOOL)isValidImageURL:(NSString *)url;
/// 检查字符串是否为图片格式(通过扩展名判断)
+ (BOOL)isImageFormat:(NSString *)url;
@end
NS_ASSUME_NONNULL_END