DEV Community

Discussion on: String.Compare() or String.Contains(), best way to compare strings

Collapse
 
katnel20 profile image
Katie Nelson

There are usually more conditions to factor in like case and culture. How would that affect your best method for comparison?

Collapse
 
deogadkarravina profile image
Ravina Deogadkar

Definitely there is some case where regex are the only solution when the input string is not none but we know the pattern of input string. But the conditions I have explained are the ones I am facing with my recent project. I am dealing with a string token where, some string token are completely unique and for some tokens first few characters do repeat and they are bit of same type. For such case they are ideal solution.