如何将两个Unicode字符合并为一个

时间:2017-01-04 10:24:14

标签: arrays swift string character

这就是我的意思:

let desiredResult: Character = "ї\u{0308}\u{20dd}"

let first: Character = "ї\u{0308}"
let combinedResult: Character = Array("\(first)\u{20dd}".characters)[0]

我怎样才能更优雅地写下这个烂摊子?

1 个答案:

答案 0 :(得分:0)

只需将String投入Character初始化程序:

let result = Character("\(first)\u{20dd}")