String
public extension String
Extension for String functionality.
-
Extends the functionality of a String with the ability to replace one string with another string.
Declaration
Swift
func replace(_ string: String, with replaceString: String) -> String
Parameters
string
The String Object. The string to be replaced.
replaceString
The String Object. Whose string will be replaced by the original string.
Return Value
The String Object that contains a string with replaced string.
-
Extends the functionality of a String with the ability to replace symbol with Zwnj symbol.
Declaration
Swift
mutating func replaceSymbolWithZwnj(symbol: String) -> String
Parameters
symbol
The String Object.
Return Value
The String Object that contains a string with zwnj symbol replaced with another symbol.
-
Extends the functionality of a String with the ability to slice one string from another string.
Declaration
Swift
func slice(from: String, to: String) -> String?
Parameters
from
The String Object. The beginning of the string from which the fragment will be cut.
to
The String Object. The end of string to which the fragment will be cut.
Return Value
The String Object that contains a string between from string and to string.