recursive function in asp.net 1,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
-
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
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 -
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 -
sir, Problem is in recursion.Can you send me the code in recursive function. Thanks and Regards Amaneet Brar
can u send the code to nidheeshkayal@gmail.com coolsweety
-
can u send the code to nidheeshkayal@gmail.com coolsweety
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