String
struct String
This adds various functionality to the String class.
-
This tests a string to see if a given substring is present at the start.
Declaration
Swift
func beginsWith(_ inSubstring: String) -> BoolParameters
inSubstringThe substring to test.
Return Value
true, if the string begins with the given substring.
-
The following function comes from this: http: //stackoverflow.com/a/27736118/879365
This extension function cleans up a URI string.
Declaration
Swift
func URLEncodedString() -> String?Return Value
a string, cleaned for URI.
-
The following function comes from this: http: //stackoverflow.com/a/27736118/879365
This extension function creates a URI query string from given parameters.
Declaration
Swift
static func queryStringFromParameters(_ parameters: [String : String]) -> String?Parameters
parametersa dictionary containing query parameters and their values.
Return Value
a String, with the parameter list.
-
Cleans
a URIDeclaration
Swift
func cleanURI() -> String!Return Value
an implicitly unwrapped optional String. This is the given URI,
cleaned up.
http[s]: //
may be prefixed. -
Cleans
a URI, allowing SSL requirement to be specified.Declaration
Swift
func cleanURI(sslRequired: Bool) -> String!Parameters
sslRequiredIf true, then we insist on SSL.
Return Value
an implicitly unwrapped optional String. This is the given URI,
cleaned up.
http[s]: //
may be prefixed.
-
Undocumented
Declaration
Swift
var firstUppercased: String { get }
View on GitHub
String Extension Reference