Export (0) Print
Expand All

String::StartsWith Method (String, Boolean, CultureInfo)

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

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

bool StartsWith(
	String^ value, 
	bool ignoreCase, 
	CultureInfo^ culture


Type: System::String

The string to compare.

Type: System::Boolean

true to ignore case during the comparison; otherwise, false.

Type: System.Globalization::CultureInfo

Cultural information that determines how this string and value are compared. If culture is nullptr, the current culture is used.

Return Value

Type: System::Boolean
true if the value parameter matches the beginning of this string; otherwise, false.


value is nullptr.

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.

The following example determines whether a string occurs at the beginning of another string. The StartsWith method is called several times using case sensitivity, case insensitivity, and different cultures that influence the results of the search.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft