不區分大小寫的“包含(字串)” - Case insensitive 'Contains(string)'

語言: CN / TW / HK

問題:

Is there a way to make the following return true?有沒有辦法使以下返回true?

string title = "ASTRINGTOTEST";
title.Contains("string");

There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both, but that's just silly (by which I am referring to the i18n issues that come with up- and down casing).似乎沒有允許我設定區分大小寫的過載.. 目前我將它們都大寫,但這只是愚蠢的(我指的是上下大小寫的i18n問題)。

UPDATE更新
This question is ancient and since then I have realized I asked for a simple answer for a really vast and difficult topic if you care to investigate it fully.這個問題很古老,從那時起我就意識到,如果您願意對一個非常龐大而困難的話題進行全面調查,我會要求一個簡單的答案。
For most cases, in mono-lingual, English code bases this answer will suffice.對於大多數情況,在單語、英語程式碼庫中,這個答案就足夠了。 I'm suspecting because most people coming here fall in this category this is the most popular answer.我懷疑是因為大多數來這裡的人都屬於這一類,這是最受歡迎的答案。
This answer however brings up the inherent problem that we can't compare text case insensitive until we know both texts are the same culture and we know what that culture is.然而,這個答案帶來了一個固有的問題,即在我們知道兩個文字是相同的文化並且我們知道該文化是什麼之前,我們無法比較不區分大小寫的文字。 This is maybe a less popular answer, but I think it is more correct and that's why I marked it as such.這可能是一個不太受歡迎的答案,但我認為它更正確,這就是我將其標記為這樣的原因。


解決方案:

參考一: https://stackoom.com/question/1riA
參考二: Case insensitive 'Contains(string)'
「其他文章」