String
extension String: LHSStringType, LHSURLStringType
-
A string identifical to
selfif not an empty string,nilotherwise.See also
Optional.nilIfEmptyDeclaration
Swift
var nilIfEmpty: String? { get } -
The length of the current string.
Declaration
Swift
var length: Int { get } -
An
NSRangeencompassing all ofself.Declaration
Swift
var range: NSRange { get } -
Returns a
Range<String.Index>equivalent to the providedNSRangeforself.Declaration
Swift
@available(*, deprecated, message: "Now in the Swift Standard Library. Use `Range(_:in:﹚` instead.") func toRange(_ range: NSRange) -> Range<String.Index> -
Trims all characters from the string in the specified
CharacterSet.Declaration
Swift
mutating func trim(_ characterSet: CharacterSet) -
URL encode the current string.
Declaration
Swift
mutating func URLEncode() -
Undocumented
Declaration
Swift
mutating func replaceSpacesWithDashes() -
Undocumented
Declaration
Swift
mutating func replaceCapitalsWithUnderscores() -
A copy of
selfwith the first letter lowercased.Declaration
Swift
var stringByLowercasingFirstLetter: String { get } -
A copy of
selfwith the first letter uppercased.Declaration
Swift
var stringByUppercasingFirstLetter: String { get } -
A URL encoded copy of the current
String.Declaration
Swift
var URLEncodedString: String? { get } -
A copy of the current
Stringwith all spaces replaced with dashes.Declaration
Swift
var stringByReplacingSpacesWithDashes: String { get } -
Undocumented
Declaration
Swift
func stringByConverting(toNamingFormat naming: VariableNamingFormat) -> String -
Undocumented
Declaration
Swift
mutating func convert(toNamingFormat naming: VariableNamingFormat) -
Undocumented
Declaration
Swift
func isComposedOf(charactersInSet characterSet: CharacterSet) -> Bool
View on GitHub
String Extension Reference