question about split function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kunaltilak
    New Member
    • Jan 2008
    • 2

    #1

    question about split function

    hello sir,
    please help me out for a asp.net(c#) problem.
    i want to split string( a.<span style="font: 7pt 'Times New Roman'">&nbsp;& nbsp;&nbsp;&nbs p;&nbsp;&nbsp; </span></span>f is continuous if and only if a &gt; 0 </p>
    <p class="MsoNorma l" style="margin-left: 1in; text-indent: -0.25in; mso-list: l0 level2 lfo1; tab-stops: list 1.0in"><span style="mso-list: Ignore">b.<span style="font: 7pt 'Times New Roman'">&nbsp;& nbsp;&nbsp;&nbs p;&nbsp; </span></span>f<span style="font-family: Symbol; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Symbol"><span style="mso-char-type: symbol; mso-symbol-font-family: Symbol">&#162;</span></span>(0) exists if and only if a &gt; 1</p>
    )
    and the delimiters are a. and b. my code is

    using System.Text.Reg ularExpressions ;

    string[] abc = Regex.Split(fin alString, "( a. | b. )");

    foreach (string match in abc)
    {

    string FinalSplitStrin g= match;

    }
    where final string is the string which i mention above.
    how can i split he above string?
    thanking you.

    with regards,
    kunal
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    So you want the section of the string that starts with "a" and ends with "b"?
    What happens if there are other "b"s or "a"s in there, not at places you wanted to split?

    Since in this tiny part of the string alone:
    Code:
     a.<span style="font: 7pt 'Times New Roman'">&nbsp
    There is:
    a.<span style="font: 7pt 'Times New Roman'">&nbsp

    Comment

    Working...