Home > DeveloperSection > Forums > String extraction in asp.net
Tanuj Kumar

Total Post:134

Posted on    November-27-2014 12:59 AM

 ASP.Net ASP.Net 

 1 Reply(s)
 488  View(s)
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?

Pravesh Singh

Total Post:411

Posted on    November-27-2014 1:53 AM

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];

Don't want to miss updates? Please click the below button!

Follow MindStick