Determine whether a string begins with a given sequence

suggest change
string HelloWorld = "Hello World";
HelloWorld.StartsWith("Hello"); // true
HelloWorld.StartsWith("Foo"); // false

Finding a string within a string

String.Contains reports whether a string contains a substring. It returns true when the substring is present and false otherwise.

string s = "Hello World";
bool stringExists = s.Contains("ello");  //stringExists =true as the string contains the substring

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents