Search This Blog

Friday, March 29, 2013

StartWith string C#

C# > String > Methods > StartWith

StartWith determines whether the beginning of  a string matches the specified value.

string str = "--comment--";
if (str.StartsWith("--"))
   str = "comment";