Summary
Tests whether the specified string contains the given search string.
Syntax
[Function("contains")]
public static bool Contains(string source, string value)
Examples
string::contains('testing string', 'test') ==> true
string::contains('testing string', '') ==> true
string::contains('testing string', 'Test') ==> false
string::contains('testing string', 'foo') ==> false
This function performs a case-sensitive word search using the
invariant culture.
Attributes
Type |
Description |
FunctionAttribute |
Indicates that the method should be exposed as a function in NAnt build
files.
|
Parameters
Name |
Type |
Description |
source |
string |
The string to search. |
value |
string |
The string to locate within source. |
Return Value
Type |
Description |
bool |
true if value is found in
source; otherwise, false .
|