feature: Added remove last emoji ability
This commit is contained in:
parent
df2fa8aed8
commit
c010ef24a4
4 changed files with 316 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
using System.Text.RegularExpressions;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -12,5 +13,12 @@ namespace Messaging.Composer {
|
|||
public void WriteEmoji(string emoji) {
|
||||
fieldText.text += emoji;
|
||||
}
|
||||
|
||||
private readonly Regex _removeRegex = new(@"<([a-z]+)(?![^>]*\/>)[^>]*>(?!.*<([a-z]+)(?![^>]*\/>)[^>]*>)");
|
||||
|
||||
public void RemoveEmoji() {
|
||||
string newText = _removeRegex.Replace(fieldText.text, "");
|
||||
fieldText.SetText(newText);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue