I am trying to parse a string and remove the 'emojis' off it and keep the new lines.
So, I have this piece of code:
string text = "S H A V A . Est 2015\nBandung\nLine: @ubm5921j\nBbm: 7D2E6310\nFAST ORDER\ud83d\udc47\ud83c\udffe\ud83d\udc47\ud83c\udffe";
MessageBox.Show(text);
string result = Regex.Replace(text, @"\p{Cs}", "");
The output of 'text' here is the following:
So, as you can see the new lines work fine and the end of it has 'emojis' and the next line it removes them PERFECTLY. So the result string will contain the same string with new lines and no emojis.
On another part of the program I have this code.
//uu.description is the same string as above 'text',
//this is where I scrape directly from html
string text2 = uu.description;
MessageBox.Show(text2);
string result2 = Regex.Replace(text2, @"\p{Cs}", "");
As you can see in this case, my text2 outputs the string in the format as it is, and the regex does absolutely nothing. The new lines don't work and the emojis are not removed.
I am very confused why it does work in my first case and not in the second case. I've been on this for hours and can't figure it out.