var specializationTitles = ["a", "b", "c", "d"] let outputString = join(" / ", specializationTitles)
出现错误:
无法join使用类型为参数的列表进行调用(String, [String])
join
(String, [String])
如何解决呢?
let separator = " / " let outputString = separator.join(specializationTitles)
使用Xcode7beta6:
specializationTitles.joinWithString(" / ")
带有Xcode7发行版:
specializationTitles.joinWithSeparator(" / ")