Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. recursive function in asp.net 1,1

recursive function in asp.net 1,1

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amaneet
    wrote on last edited by
    #1

    Sir, I want to remove the substring "<br>" in the string for that i am trying a recursive function.But not getting the success in making the recursive function. The string is like this this is a string <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>. Please help me. Thanks and regards Amaneet Brar

    C 1 Reply Last reply
    0
    • A amaneet

      Sir, I want to remove the substring "<br>" in the string for that i am trying a recursive function.But not getting the success in making the recursive function. The string is like this this is a string <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>. Please help me. Thanks and regards Amaneet Brar

      C Offline
      C Offline
      chakkara2003
      wrote on last edited by
      #2

      protected void Page_Load(object sender, EventArgs e) { string str = "this is a string

      "; StringBuilder strbui = new StringBuilder(str); funcTest(strbui); } public void funcTest(StringBuilder strb) { string str1="",str2=""; for (int Loop = 0; Loop < strb.Length; Loop++) { if (strb[Loop].Equals(' ')) { if (str1.Equals("
      ")) { strb.Remove(Loop - 4, 4); } else { str2 = str2 + str1; str2 = str2 + " "; str1 = ""; } } else { str1 = str1 + strb[Loop]; } } Response.Write(str2); } coolsweety

      A 1 Reply Last reply
      0
      • C chakkara2003

        protected void Page_Load(object sender, EventArgs e) { string str = "this is a string

        "; StringBuilder strbui = new StringBuilder(str); funcTest(strbui); } public void funcTest(StringBuilder strb) { string str1="",str2=""; for (int Loop = 0; Loop < strb.Length; Loop++) { if (strb[Loop].Equals(' ')) { if (str1.Equals("
        ")) { strb.Remove(Loop - 4, 4); } else { str2 = str2 + str1; str2 = str2 + " "; str1 = ""; } } else { str1 = str1 + strb[Loop]; } } Response.Write(str2); } coolsweety

        A Offline
        A Offline
        amaneet
        wrote on last edited by
        #3

        sir, Problem is in recursion.Can you send me the code in recursive function. Thanks and Regards Amaneet Brar

        C 1 Reply Last reply
        0
        • A amaneet

          sir, Problem is in recursion.Can you send me the code in recursive function. Thanks and Regards Amaneet Brar

          C Offline
          C Offline
          chakkara2003
          wrote on last edited by
          #4

          can u send the code to nidheeshkayal@gmail.com coolsweety

          A 1 Reply Last reply
          0
          • C chakkara2003

            can u send the code to nidheeshkayal@gmail.com coolsweety

            A Offline
            A Offline
            amaneet
            wrote on last edited by
            #5

            Sir, This is the recursive function. Private Function removethenextline(ByVal line As String) As String Dim counting As Integer If (InStr(line, " ", CompareMethod.Text)) Then counting = InStr(line, " ", CompareMethod.Text) line = line.Remove(counting - 1, 4) removethenextline = line End If End Function Please improve the code Thanks and regards Amaneet Brar

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups