What are the reasons not to use “==” to compare localized strings in .NET? How would the comparison execute in regards to the CultureInfo if I do use it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
==is culture-insensitive – it’s a simple ordinal comparison. So two strings which are culturally equal – or even equal in terms of other canonicalization forms – may not be equal via==. It basically treats each string like achararray.