Improved the implementation of the "isNotEmpty" property in the String+Empty extension.
This commit is contained in:
@@ -12,17 +12,14 @@
|
||||
|
||||
public extension String {
|
||||
|
||||
// MARK: Properties
|
||||
// MARK: Constants
|
||||
|
||||
/// Represents an empty string.
|
||||
/// A string that represents an empty string.
|
||||
static let empty = ""
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
/// Checks whether a string is not empty.
|
||||
/// - Returns: A boolean value that represents whether the string is not empty.
|
||||
func isNotEmpty() -> Bool {
|
||||
isEmpty == false
|
||||
}
|
||||
// MARK: Properties
|
||||
|
||||
/// A Boolean value indicating whether a string is not empty.
|
||||
var isNotEmpty: Bool { !isEmpty }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user