NAnt SDK Documentation - v0.92 |

# StringFunctions.EndsWith Method

Tests whether the specified string ends with the specified suffix string.

[Visual Basic]
<Function(Name:="ends-with")>
Public Shared Function EndsWith( _
ByVal s1 As String, _
ByVal s2 As String _
) As Boolean
[C#]
[Function(Name="ends-with")]
public static bool EndsWith(
string s1,
string s2
);

#### Parameters

s1
  test string
s2
  suffix string

#### Return Value

true when s2 is a suffix for the string s1. Meaning, the characters at the end of s1 are identical to s2; otherwise, false.

#### Remarks

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

#### Example

    string::ends-with('testing string', 'string') ==> true

    string::ends-with('testing string', '') ==> true

    string::ends-with('testing string', 'bring') ==> false

    string::ends-with('string', 'testing string') ==> false

#### See Also

StringFunctions Class | NAnt.Core.Functions Namespace