STRING EXTRACTION IN ASP.NET

Tanuj Kumar

Total Post:134

Points:940
Posted by  Tanuj Kumar
 719  View(s)
Ratings:
Rate this:

I have a string like that

"Monsoon Season | 20-05-2014 | 06-10-2014"

I want to extract string before and after the pipe sybmol . How can I do it?

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: String extraction in asp.net

    Hi Tanuj, 


    You could use String.Split():

     

    string info = "Monsoon Season | 20-05-2014 | 06-10-2014";

    var strings = info.Split('|');

    string title = strings[0];

    string date = strings[2];

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!