mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-26 17:43:22 +01:00
24 lines
436 B
Swift
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
|
|
}
|
|
}
|