Essential C# Common String Operations  Suggest an edit

Determine whether a string begins with a given sequence

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

Finding a string within a string

Using the System.String.Contains you can find out if a particular string exists within a string. The method returns a boolean, true if the string exists else false.

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

Table Of Contents
11 Common String Operations
22 Enum
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close