System.String.StartsWith Method

Determines whether the beginning of this string instance matches the specified string when compared using the specified culture.

Syntax

public bool StartsWith (string value, bool ignoreCase, System.Globalization.CultureInfo culture)

Parameters

value
The string to compare.
ignoreCase
true to ignore case during the comparison; otherwise, false.
culture
Cultural information that determines how this string and value are compared. If culture is null, the current culture is used.

Returns

true if the value parameter matches the beginning of this string; otherwise, false.

Remarks

This method compares the value parameter to the substring at the beginning of this string that is the same length as value, and returns a value that indicates whether they are equal. To be equal, value must be an empty string (string.Empty), must be a reference to this same instance, or must match the beginning of this instance.

This method performs a comparison using the specified casing and culture.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0