C#StringStartsWith
EndsWith

StartsWithString

IndexOf

Determines whether the string starts with the specified characters.

Syntax

str.StartsWith(value, comparisonType?)

Example

Enter values below to update the example in real time.

string
url
isHttps
StartsWith
Console
WriteLine
string url = "https://example.com";
bool isHttps = url.StartsWith("https");
Console.WriteLine(isHttps);   // True