NSArray *faceArray = [NSArray arrayWithObjects:
@"", //第一个为空 为了和表情名称匹配
@"\ue056",@"\ue414",@"\ue402",@"\ue403",@"\ue404",@"\ue405",@"\ue401",@"\ue40b",@"\ue40c",@"\ue40d",@"\ue40e",@"\ue40f",@"\ue410",@"\ue411",@"\ue409",@"\ue408",@"\ue407",@"\ue406",@"\ue412",@"\ue413",@"\ue415",@"\ue417",@"\ue418",@"\ue416",@"\ue108",@"\ue107",@"\ue106",@"\ue105",@"\ue059",@"\ue058",@"\ue057",@"\ue022",@"\ue023",@"\ue00e",@"\ue41f",@"\ue420",@"\ue011",@"\ue032",@"\ue04a",@"\ue049",@"\ue04b",@"\ue04c",@"\ue048",@"\ue13d",@"\ue32f",@"\ue32e",@"\ue331",@"\ue449",@"\ue44b",@"\ue44c",@"\ue508",@"\ue446",@"\ue43c",@"\ue033",@"\ue05a",@"\ue10b",@"\ue11a",@"\ue12b",@"\ue13c",@"\ue112",@"\ue330",@"\ue41c",@"\ue448",@"\ue513",@"\ue536",nil];
NSArray *sendFaceTextArray = [NSArray arrayWithObjects:@"", //第一个为空 为了和表情编码数组匹配
@"[微笑]",@"[幸福]",@"[坏笑]",@"[悲伤]",@"[大笑]",@"[俏皮]",@"[流汗]",@"[惊讶]",@"[口罩]",@"[瞪眼]",@"[不屑]",@"[尴尬]",@"[叉叉]",@"[大哭]",@"[吐舌]",@"[瞌睡]",@"[痛苦]",@"[难过]",@"[苦笑]",@"[流泪]",@"[开心]",@"[亲亲]",@"[飞吻]",@"[生气]",@"[大汗]",@"[尖叫]",@"[发情]",@"[鬼脸]",@"[严肃]",@"[低落]",@"[乐观]",@"[爱心]",@"[心碎]",@"[表扬]",@"[鼓掌]",@"[okay]",@"[剪刀]",@"[玫瑰]",@"[太阳]",@"[白云]",@"[下雨]",@"[月亮]",@"[雪人]",@"[闪电]",@"[星星]",@"[闪亮]",@"[水滴]",@"[日出]",@"[流星]",@"[彩虹]",@"[游轮]",@"[丰收]",@"[雨伞]",@"[圣诞]",@"[便便]",@"[猪头]",@"[恶魔]",@"[bug]",@"[睡觉]",@"[礼物]",@"[气体]",@"[嘴唇]",@"[圣诞老人]",@"[过期]",@"[脚印]",nil];
//注意这里的判断语句 带等于号
for(int i = 1; i < sendFaceTextArray.count;)
{
NSRange range = [str rangeOfString:[sendFaceTextArray objectAtIndex:i]];
if(range.length != 0)
{
str = [str stringByReplacingCharactersInRange:range withString:[faceArray objectAtIndex:i]];
continue;
}
i++;
}
return str;