i split a string into single letters and then do further work with the returned array. Now a string may contain multibyte characters (see emoji in the code example). But the String.Split/String.SplitBytes method produces two characters from the emoji. Is there a way to bypass this and really get only one character back, the whole emoji? This question comes up when using String.Left/String.Middle, because even with a wrong index only the original emoji could be returned if you forget to read the second byte. The Japanese alphabet (I think the Thai one too) is also encoded with two characters. Do you have any tips or solutions?
Const kText As String = "Hello World!" ' please add a multi-byte Emoji within the String Var letters() As String = kText.Split("") For Each letter As String in Letters System.DebugLog(letter) Next
Const kText As String = "Hello World!" ' please replace "Hello World!" with a multi-byte Emoji Var s1 As String = kText.Left(1) ' returns partial of the multi-byte letter Var s2 As String = kText.Left(2) ' returns the whole multi-byte letter
Note: The forum only allows the display of single-byte emojis. Please try the code with a multi-byte emoji!