Click or drag to resize
StringStartsWith Method (String, StringComparison)
Determines whether the beginning of this string instance matches the specified string when compared using the specified comparison option.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public bool StartsWith(
	string value,
	StringComparison comparisonType
)

Parameters

value
Type: SystemString
The string to compare.
comparisonType
Type: SystemStringComparison
One of the enumeration values that determines how this string and value are compared.

Return Value

Type: Boolean
true if this instance begins with value; otherwise, false.
Exceptions
ExceptionCondition
ArgumentNullExceptionvalue is null.
ArgumentExceptioncomparisonType is not a StringComparison value.
See Also