New version v2.3.6
This commit is contained in:
@@ -93,6 +93,13 @@ extension String {
|
||||
return max(1, count / 4)
|
||||
}
|
||||
|
||||
// MARK: - Nil coalescing helpers
|
||||
|
||||
/// Returns nil if the string is empty, otherwise self.
|
||||
var nonEmptyOrNil: String? {
|
||||
isEmpty ? nil : self
|
||||
}
|
||||
|
||||
// MARK: - Truncation
|
||||
|
||||
func truncated(to length: Int, trailing: String = "...") -> String {
|
||||
|
||||
Reference in New Issue
Block a user