String
struct String
-
Parses a format string using a dictionary of arguments
Replaces occurrences of
"${key}"with their respective values.String(format: "Hello, ${user}", ["user": "Flavio"]) // Hello, FlavioDeclaration
Swift
init(format: String, arguments: [String: CustomStringConvertible])Parameters
formatThe string to be formatted.
argumentsA dictionary containing the which keys should be replaced by which values.
Return Value
A formatted string
String Extension Reference