我有一个textview,并且在显示文本时,文本中带有括号。我想消除它们。这是我的代码:
self.txtpstn.text = "\(self.no_pstn.self as NSArray)"
self.txtmobile.text = "\(self.no_mobile.self as NSArray)"
这是应用程序上的显示:
答案 0 :(得分:1)
使用连接:
self.txtpstn.text = "\((self.no_pstn.self as NSArray).componentsJoined(by: ","))"
self.txtmobile.text = "\(self.no_mobile.self as NSArray).componentsJoined(by: ","))"