Hyphens and dashes difference?

I have received a string from a client that looks like this: "----Code".

When I search for "----Code", it doesn't result in a match. Only when I search for "Code" it works.


Any ideas ? :)





Last edited on
Examine the actual numerical values of the characters in the client string (and your search string) to confirm they're the same (or not).

1
2
3
4
  for (const auto& elem : the_string)
  {
      std::cout << static_cast<unsigned>(elem) << ' ';
  }



https://ideone.com/U0Kx8R
If the message is in unicode, there's tons of different dashes or hyphen or minus sign characters.
https://en.wikipedia.org/wiki/Dash#Common_dashes_and_Unicode_characters
Last edited on
Topic archived. No new replies allowed.