Determines whether a specified string is a prefix of the current instance.
[Visual Basic] Public Function StartsWith( _ ByVal value As String _ ) As Boolean [C#] public bool StartsWith( string value ); [C++] public: bool StartsWith( String* value ); [JScript] public function StartsWith( value : String ) : Boolean;
true if either value matches the beginning of this string or value is an empty string, otherwise false.
Exception Type | Condition |
---|---|
ArgumentNullException | If the string is null. |
The StartsWith method makes a comparison at the beginning of the string, determines whether it matches this current instance, and returns a Boolean represetation of their relationship. The specified string must match the prefix or be an empty string (i.e., equals Empty). The comparison is case-sensitive.