2
string x = "";
Console.WriteLine(string.Join("",x.Where(y => y == "")));

y = char. how do I do this y = string?

I want "y = string" and I can compare whether this string is equal to this emoji

Rand Random
  • 7,300
  • 10
  • 40
  • 88
MaKeSter
  • 73
  • 7
  • Use IndexOf method – Chetan Apr 23 '23 at 19:16
  • What exactly is the idea here? A string consists of chars. Using LINQ in this way is like iterating over all the chars while you're looking for more than a single char. – Julian Apr 23 '23 at 19:17
  • 3
    I don't think this way will work, since isn't a char, it's two chars: \ud83d and \ude01 - you'll need to look for both of them next to each other. – Mike Christensen Apr 23 '23 at 19:18
  • 4
    Note that `U+1F601 GRINNING FACE WITH SMILING EYES` does *not* fit in a `char` as that only holds a single 16-bit code point; it's more appropriately a substring of your original string. – Jeroen Mostert Apr 23 '23 at 19:18
  • Splitting into an array of strings helped now y = string – MaKeSter Apr 23 '23 at 19:24

0 Answers0