Skip to main content
deleted 36 characters in body
Source Link
TylerH
  • 21.3k
  • 84
  • 84
  • 121

You could always just up or downcase the strings first.

string title = "string":
title.ToUpper().Contains("STRING")  // returns true

Oops, just saw that last bit. AA case insensitive compare would *probably*probably do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. II could have sworn that I once saw a case-insensitive compare once...

You could always just up or downcase the strings first.

string title = "string":
title.ToUpper().Contains("STRING")  // returns true

Oops, just saw that last bit. A case insensitive compare would *probably* do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. I could have sworn that I once saw a case-insensitive compare once...

You could always just up or downcase the strings first.

string title = "string":
title.ToUpper().Contains("STRING")  // returns true

A case insensitive compare would probably do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. I could have sworn that I once saw a case-insensitive compare once...

edited body
Source Link
Ed Swangren
  • 125k
  • 24
  • 189
  • 270

You could always just up or downcase the strings first.

string title = "STRING""string":
title.ToLowerToUpper().Contains("string""STRING")  // returns true

Oops, just saw that last bit. A case insensitive compare would *probably* do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. I could have sworn that I once saw a case-insensitive compare once...

You could always just up or downcase the strings first.

string title = "STRING":
title.ToLower().Contains("string")  // returns true

Oops, just saw that last bit. A case insensitive compare would *probably* do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. I could have sworn that I once saw a case-insensitive compare once...

You could always just up or downcase the strings first.

string title = "string":
title.ToUpper().Contains("STRING")  // returns true

Oops, just saw that last bit. A case insensitive compare would *probably* do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. I could have sworn that I once saw a case-insensitive compare once...

Source Link
Ed Swangren
  • 125k
  • 24
  • 189
  • 270

You could always just up or downcase the strings first.

string title = "STRING":
title.ToLower().Contains("string")  // returns true

Oops, just saw that last bit. A case insensitive compare would *probably* do the same anyway, and if performance is not an issue, I don't see a problem with creating uppercase copies and comparing those. I could have sworn that I once saw a case-insensitive compare once...