Method Like
Like(String, String, Boolean)
Performs an operation similar to a T-Sql 'like' on a string.
Declaration
public static bool Like(this string value, string pattern, bool caseInsensitive)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string to search. |
System.String | pattern | The partial string to match, including wild cards. |
System.Boolean | caseInsensitive | If true case is ignored when matching strings, if false case sensitivity applies. |
Returns
Type | Description |
---|---|
System.Boolean | True if the partial string to match is found in the |
Remarks
Use % as a wildcard for any character or characters, and _ as a wild card for any single character.
This method is 'allocation heavy'. It's fine for use in execution paths that are infrequent/not performance critical, but in other such places a fine tuned manual implementation would be better.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |