1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-24 18:48:01 +02:00

Merge pull request #1255 from disarray2077/patch-2

Add ignore case option for StringView.Contains & Improve String.Contains
This commit is contained in:
Brian Fiete 2021-12-06 09:32:37 -08:00 committed by GitHub
commit 82ca2fd72c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1429,12 +1429,7 @@ namespace System
return -1;
}
public bool Contains(String str)
{
return IndexOf(str) != -1;
}
public bool Contains(String str, bool ignoreCase)
public bool Contains(StringView str, bool ignoreCase = false)
{
return IndexOf(str, ignoreCase) != -1;
}
@ -3291,9 +3286,9 @@ namespace System
return false;
}
public bool Contains(StringView stringView)
public bool Contains(StringView stringView, bool ignoreCase = false)
{
return IndexOf(stringView) != -1;
return IndexOf(stringView, ignoreCase) != -1;
}
public bool StartsWith(StringView b, StringComparison comparisonType = StringComparison.Ordinal)