You must Sign In to post a response.
  • Category: ASP.NET

    How to split a string based on the duplicate

    string dd=1,2,3,4,5,1,2,3,4,3,1,2,3

    is there any way to split the string based on duplicate value in the string



    string dd=(1,2,3,4,5)
    string 2nd=(1,2,3,4)
    string 3rd=(3,1,2,3)

    please help me thanks in advance
  • #768568
    what you mean by duplicate value ?
    do you want to break the string when repeat a character
    if yes then your bifurcation will be as follows

    string dd=1,2,3,4,5,1,2,3,4,3,1,2,3
    string 1 = 1,2,3,4,5
    string 2 = 1 (break the string as 2 is duplicate)
    string 3 = 2 (break the string as 3 is duplicate)
    string 4 = 3 (break the string as 4 is duplicate)
    is my understanding is right ? please suggest

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #768571
    i want to split this into 2
    (0-7,0-10,0-5,2-6,2-10,2-3,2-11)
    (0-7,0-10,0-5,)
    (2-6,2-10,2-3,2-11)


Sign In to post your comments