tokenary/Shared/Extension/String.swift

25 lines
486 B
Swift
Raw Normal View History

2021-11-30 15:56:00 +03:00
// Copyright © 2021 Tokenary. All rights reserved.
2021-08-01 17:12:11 +03:00
import Foundation
extension String {
var maybeJSON: Bool {
return hasPrefix("{") && hasSuffix("}") && count > 3
}
2021-12-07 20:35:14 +03:00
var isOkAsPassword: Bool {
return count >= 4
}
var withFirstLetterCapitalized: String {
guard !isEmpty else { return self }
return prefix(1).uppercased() + dropFirst()
}
2021-12-09 17:42:45 +03:00
var withEllipsis: String {
return self + ""
}
2021-08-01 17:12:11 +03:00
}