0

I have following two unicodes

 let countryFlag1 =  "0x1F1E6"
 let countryFlag2 =  "0x1F1E9"

How to concat two unicodes to and assign it to textfield

Tried following it is working but don't know how to do it with variable as there can be multiple values.

selectContryTextField.text = "\u{1F1E6}\u{1F1E9}"
rmaddy
  • 314,917
  • 42
  • 532
  • 579
amodkanthe
  • 4,345
  • 6
  • 36
  • 77
  • Where do the values for `countryFlag1` and `countryFlag2` come from? It would be a lot easier if you avoided such a format. – rmaddy Jun 25 '19 at 16:01
  • they are coming from json response – amodkanthe Jun 25 '19 at 16:02
  • Why doesn't the JSON encode those characters in a standard way using `\u1F1E6`, etc.? Then when you parse the JSON in your Swift code, you will get the expected characters without any extra processing. – rmaddy Jun 25 '19 at 16:09

0 Answers0