我試圖從其他字符/單詞/表情符號中給定文本中分隔表情符號。我希望稍後將表情符號用作文本分類中的功能。所以重要的是我將每個表情符號單獨作爲一個獨立的角色對待。 代碼: import re
text = "I am very #happy man but my wife is not "
print(text) #line a
reg = re.compile(u'['
u'\U0
我試圖對Emojis進行編碼和解碼,將它們發送到我的數據庫。 我用這個編碼: var comentario = String()
let data = Comment.data(using: String.Encoding.nonLossyASCII, allowLossyConversion: true)
if let data = data {
let emojiString =
let myString = "☺️"
let emoji = "☺️☹️"
let characterSet = CharacterSet(charactersIn: emoji)
let range = (myString as NSString).rangeOfCharacter(from: characterSet)
(myString as NSString).substr