NAnt SDK Documentation - v0.92 |

# StringFunctions.Contains Method

Tests whether the specified string contains the given search string.

[Visual Basic]
<Function(Name:="contains")>
Public Shared Function Contains( _
ByVal source As String, _
ByVal value As String _
) As Boolean
[C#]
[Function(Name="contains")]
public static bool Contains(
string source,
string value
);

#### Parameters

source
  The string to search.
value
  The string to locate within source.

#### Return Value

true if value is found in source; otherwise, false.

#### Remarks

This function performs a case-sensitive word search using the invariant culture.

#### Example

    string::contains('testing string', 'test') ==> true

    string::contains('testing string', '') ==> true

    string::contains('testing string', 'Test') ==> false

    string::contains('testing string', 'foo') ==> false

#### See Also

StringFunctions Class | NAnt.Core.Functions Namespace