Mono Class Library: System.String Overview | Members

System.String.StartsWith Method

Returns a bool value that indicates whether the start of the current instance matches the specified string. [Edit]

public bool StartsWith (string value)

Parameters

value
A string . [Edit]

Returns

true if the start of the current instance is equal to value; false if value is not equal to the start of the current instance or is longer than the current instance. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionvalue is a null reference. [Edit]

Remarks

This method compares value with the substring at the start of the current instance that has a length of value.Length. If value.Length is greater than the length of the current instance or the relevant substring of the current instance is not equal to value, this method returns false; otherwise, this method returns true .

The comparison is case-sensitive.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0