聚合云播

排序

劝导剧情简介

" let result = "" // 使用正则表达式替换为"" result = content.replacingOccurrences(of: "<[\/\!]*?[^<>]*?>", with: "", options: .regularExpression) //除去空格符和换行符,正则 result = result.replacingOccurrences(of: "\s", with: "", options: .regularExpression) return result}// 扩展String,支持下标截取/// 需要屏蔽extension String { public subscript(range: NSRange?) -> Substring? { guard let range = range else{ return nil } //将NSRange转换成Range let index1 = self.index(self.startIndex, offsetBy: range.location) let index2 = self.index(self.startIndex, offsetBy: range.length) let range_new = index1..