string str = "..."; if (str.Contains("..."))
이것(Contains)는 Case Intensive 찾기를 할 수 없다. 대신
IndexOf
+
StringComparison
.
CurrentCultureIgnoreCase
를 사용하면 Case Intensive한 포함 찾기를 할 수 있다.
즉,
public static bool ContainsCaseInsensitive(this string source, string value) { int results = source.IndexOf(value, StringComparison.CurrentCultureIgnoreCase); return results == -1 ? false : true; }
.NET
C Sharp
Case Intensive
string
Retrieved from http://hyacinth.byus.net/moniwiki/wiki.php/C_Sharp/ContainsCaseIntensiveString 메소드
last modified 2015-02-12 15:30:20