1

The first print statement below works fine but not the second. The second one generates the error "Expected '}" in \u{...} escape sequence". (They should (in theory) be the same,)

print("\u{F0A5}")
let generatedValue = "F0A5"
print("\u{\(generatedValue)}")

I've tried various formatting tricks without success. How do I overcome this error to produce an escaped special character string on the fly?

Vince O'Sullivan
  • 2,611
  • 32
  • 45
  • Well spotted, those people. It was hardly likely I was first to come across this problem but was unable to formulate a successful Google search. – Vince O'Sullivan Jan 03 '17 at 17:11

0 Answers0