Class StringExtensions
A set of extensions methods over strings, useable in LINQ queries.
Namespace: Realms
Assembly: Realm.dll
Syntax
public static class StringExtensions
Methods
| Edit this page View SourceContains(string, string, StringComparison)
Returns a value indicating whether a specified substring occurs within this string.
Declaration
[Obsolete("Use QueryMethods.Contains instead")]
public static bool Contains(this string str, string value, StringComparison comparisonType)
Parameters
Type | Name | Description |
---|---|---|
string | str | The original string. |
string | value | The string to seek. |
StringComparison | comparisonType | One of the enumeration values that determines how this string and value are compared. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |
ArgumentException | Thrown when |
Like(string, string, bool)
Performs a 'like' comparison between the specified string and pattern.
Declaration
[Obsolete("Use QueryMethods.Like instead")]
public static bool Like(this string str, string pattern, bool caseSensitive = true)
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to compare against the pattern. |
string | pattern | The pattern to compare against. |
bool | caseSensitive | If set to |
Returns
Type | Description |
---|---|
bool |
|
Remarks
?
and are allowed where
?
matches a single character and matches zero or
more characters, such that
?bc*
matches abcde
and bbc
, but does not match bcd
.