Method ContainsOnly
ContainsOnly(String, Char[])
Returns true if value contains only characters that exist in characters.
Declaration
public static bool ContainsOnly(this string value, params char[] characters)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | |
| System.Char[] | characters |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if |
Remarks
Returns false if value is empty string.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
ContainsOnly(String, IEnumerable<Char>)
Returns true if value contains only characters that exist in characters.
Declaration
public static bool ContainsOnly(this string value, IEnumerable<char> characters)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | |
| System.Collections.Generic.IEnumerable<System.Char> | characters |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if |
Remarks
Returns false if value is empty string.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |