cut the string

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,<br/><br/>I have a string Like - "Jeff_02-May-2007_Account.xls" I need to cut the string <br/><br/>1.Jeff 2. 02-May-2007 3. Account.xls<br/><br/>Here i am doing like this<br/><br/><br/><span style="font-size:x-small;color:#008080 <span style="font-size:x-small;color:#008080 <font size=2 color="#008080 <font size=2 color="#008080
Regex
</font></font><font size=2 color="#008080
 
</font>
<span style="font-size:x-small exp = <span style="font-size:x-small;color:#0000ff <span style="font-size:x-small;color:#0000ff new<span style="font-size:x-small <span style="font-size:x-small;color:#008080 <span style="font-size:x-small;color:#008080 Regex<span style="font-size:x-small (<span style="font-size:x-small;color:#800000 <span style="font-size:x-small;color:#800000 @"^[a-zA-Z0-9s]+"<span style="font-size:x-small );<font size=2>
 
</font>
<span style="font-size:x-small;color:#008080 <span style="font-size:x-small;color:#008080 Match<span style="font-size:x-small aMatch = exp.Match(<span style="font-size:x-small;color:#800000 <span style="font-size:x-small;color:#800000 "<span style="color:#000000 Jeff_02-May-2007_Account.xls"<span style="font-size:x-small );<font size=2>
 
</font>
<span style="font-size:x-small;color:#0000ff <span style="font-size:x-small;color:#0000ff if<span style="font-size:x-small (aMatch != <span style="font-size:x-small;color:#0000ff <span style="font-size:x-small;color:#0000ff null<span style="font-size:x-small )
{
<font size=2>
 
</font>
<span style="font-size:x-small;color:#008080 <span style="font-size:x-small;color:#008080 MessageBox<span style="font-size:x-small .Show(aMatch.ToString());
};

I am getting the first string, how can i match 2nd and 3rd..<br/><br/>Thanks,<br/>vikas<br/>

View the full article
 
Back
Top