Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

字符处理 数组 字典 空处理

smx edited this page Sep 13, 2017 · 2 revisions

字符处理 数组 字典 空处理

#import <UIKit/UIKit.h>

  ///对请求参数做处理
  @interface NSObject (strNotEmptyValue)
    - (NSString *)strNotEmptyValue;
  @end

  ///判断字符串是否为空
  @interface NSObject (strBOOL)
    - (BOOL)strBOOL;
  @end

  ///是否是数组
  @interface NSObject (arrBOOL)
    - (BOOL)arrBOOL;
  @end

  ///返回【判断后的数组】-- 如果是字典以数组形式返回
  @interface NSObject (arrValue)
    - (NSArray *)arrValue;
  @end

  ///是否是 字典
  @interface NSObject (dictBOOL)
    - (BOOL)dictBOOL;
  @end

  ///判断字符串是否 为 Url
  @interface NSObject (urlBOOL)
    - (BOOL)urlBOOL;
  @end

  @interface NSObject (fromatValue)
    - (NSString *)formatMonery;
  @end

使用

    NSString * string = @"https://github.com/srxboys";
    
    if([string strBOOL]) {
        //是否为字符串
    }
    
    if([string urlBOOL]) {
        //是否为 网址
    }
    
    if([string arrBOOL]) {
        //是否为 数组
    }