Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. extension String.StringInterpolation {
  2. mutating func appendInterpolation(_ values: [String], default: @autoclosure () -> String) {
  3. if !values.isEmpty {
  4. appendLiteral(values.joined(separator: "->"))
  5. }else {
  6. appendLiteral(`default`())
  7. }
  8. }
  9. }
  10.  
  11. print("Values: \([],default: "Empty Array")")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement