String
public extension String
-
Returns a String removing all whitespaces, not only the leading/trailing but also in the middle of the string
Declaration
Swift
var removingWhitespaces: String { get } -
Returns a String removing the leading/trailing whitespaces and new lines
Declaration
Swift
var trimmingWhitespacesAndNewLines: String { get } -
Transform String date from one format to another
Declaration
Swift
func transformDateFormat(_ receivingFormat: String, new transforming: String) -> String?Parameters
receivingFormatactual string date format
transformingnew date format
Return Value
String with the new format or nil if fail
-
Returns a String containing only numbers or an empty String
Declaration
Swift
var numbersOnly: String { get } -
Verify if the string has one or more numbers
Declaration
Swift
var hasNumbers: Bool { get } -
Verify if the string has only numbers
Declaration
Swift
var hasOnlyNumbers: Bool { get } -
Returns a String containing only letters or an empty String
Declaration
Swift
var lettersOnly: String { get } -
Verify if the string has one or more letters
Declaration
Swift
var hasLetters: Bool { get } -
Verify if the string has only letters
Declaration
Swift
var hasOnlyLetters: Bool { get } -
Verify if the string contains at least one letter and one number
Declaration
Swift
var isAlphaNumeric: Bool { get }
-
Dictionary from string JSON format
Declaration
Swift
var toDictionary: [String : Any] { get }
-
Get number if string is brazilian currency or return nil
Declaration
Swift
var brazilianCurrencyNumber: NSNumber? { get } -
Transform string in html format to NSAttributedString with the layout of html
Declaration
Swift
var htmlToAttributedString: NSAttributedString? { get } -
Create a substring based on the range passed
Declaration
Swift
subscript(range: Range<Int>) -> String { get }Parameters
rangerange to create the substring
-
Undocumented
Declaration
Swift
subscript(range: CountableClosedRange<Int>) -> Substring { get } -
Undocumented
Declaration
Swift
subscript(range: PartialRangeUpTo<Int>) -> Substring { get } -
Undocumented
Declaration
Swift
subscript(range: PartialRangeThrough<Int>) -> Substring { get } -
Undocumented
Declaration
Swift
subscript(range: PartialRangeFrom<Int>) -> Substring { get }
View on GitHub
String Extension Reference