NetNewsWire/Modules/Parser/Sources/SAX/Extensions/String+SAX.swift

24 lines
436 B
Swift
Raw Normal View History

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