String
struct String
-
Clears cache of regular expressions.
Declaration
Swift
@available(* 0.0.4, *) public static func clearRegexCache() -
Returns matches for given regex in this string.
Throws
NSErrorif regex is malformed.Declaration
Swift
public func matches(for pattern: String) throws -> [String]Parameters
patternPattern to match in this string.
Return Value
Matches for given regex in this string.
-
Returns resulting string after removing occurrences of given substring from this string.
Declaration
Swift
public func removing(_ target: String) -> StringParameters
targetSubstring to be removed from this string.
Return Value
Resulting string.
-
Returns resulting string after removing occurrences of given substrings from this string.
Declaration
Swift
public func removing(_ targets: [String]) -> StringParameters
targetsSubstrings to be removed from this string.
Return Value
Resulting string.
-
Returns a trimmed version of this string.
Declaration
Swift
public var trimmed: String { get }
View on GitHub
Install in Dash
String Extension Reference