NetNewsWire/Modules/Parser/Sources/SAX/Extensions/String+SAX.swift
2024-08-26 22:39:46 -07:00

24 lines
436 B
Swift

//
// String+RSParser.swift
// RSParser
//
// Created by Nate Weaver on 2020-01-19.
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public extension String {
var nilIfEmptyOrWhitespace: String? {
return self.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? nil : self
}
static func isEmptyOrNil(_ s: String?) -> Bool {
if let s {
return s.isEmpty
}
return true
}
}