How to check the NULL value in NSString in iOS?

前端 未结 10 1628
盖世英雄少女心
盖世英雄少女心 2021-01-02 15:17

I have an NSString and I want to check if it has a NULL value. If it does, then the if condition should execute. Else it should execut

10条回答
  •  难免孤独
    2021-01-02 16:09

      NSString *str;
    
      if ([[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]          isEqualToString:@""] || str==nil) 
      {
    
      }
    

提交回复
热议问题