DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

C# Function - StrartsWith

  • submit to reddit
        StartsWith function is used to check whether string starts with specific word.

	string sentence = "This is dot net zone snippet";

	if (sentence.StartsWith("This"))
	    Console.WriteLine("Yes sentence begins with This");