Files
mier_ios/SweetParty/第三方库/【控件扩展】Category/NSString+BMUtils.h
2025-08-11 10:43:19 +08:00

80 lines
1.9 KiB
Objective-C
Executable File
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+BMUtils.h
// buymore
//
// Created by yuebin on 2020/6/1.
// Copyright © 2020 JLC. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (BMUtils)
/// 保留2位小数整数时取整 1.00=>1 1.0=>1 2.3333=>2.33 2.40=>2.4 2.456=>2.45
- (NSString *)formatPriceYuan;
/// 左边插入券后价¥
- (NSAttributedString *)formatCouponAttributestring;
/// 左边插入 ¥
- (NSAttributedString *)formatNoCouponAttributestring;
/// 左边插入 ¥ ; 删除样式
- (NSAttributedString *)formatSymbolAndDeleteAttributestring;
/// 删除线
- (NSAttributedString *)formatDeleteString;
/// 放大特定字体
- (NSAttributedString *)zoomWithString:(NSString *)targetStr WithSize:(float)fontSize;
///特定字体删除样式
- (NSAttributedString *)att_deleteWithString:(NSString *)targetStr;
/// 改变特定字体的颜色和大小
- (NSMutableAttributedString *)att_changeColorAndFontSizeWithString:(NSString *)targetStr WithColor:(nullable UIColor *)fontColor WithFont:(nullable UIFont *)font;
/// 用于输入框带图标的placeholder
/// @param text 默认字
/// @param imgName 图片名
+ (NSAttributedString *)placeholderAttributeSringWithText:(NSString *)text img:(NSString *)imgName;
/// x天x时x分x秒
/// @param sec 时间长度
+ (NSString*)overtime:(NSInteger)sec;
/// 返回天时分秒数组
+ (NSArray<NSString *> *)arrOvertime:(NSInteger)sec;
+ (NSString *)timeDayString;
/// 验证大陆手机号
- (BOOL)isValidPhone;
///传入时间字符串 格式化成 月-日字符串
+ (NSString *)formatTimer:(NSString *)timer;
/// url编码 去空格,适配中文
- (NSString *)formatUrlString;
///判断本地版本比线上版本大(不包括等于、大于)
/// @param onlineVersion 线上版本号
- (BOOL)versionIsBiggerThan:(NSString *)onlineVersion;
@end
NS_ASSUME_NONNULL_END