hi , I am pradeep.
i wrote a code to get all information with in brackets of each sin() ,which i would like to give as my input to text box.
but i am not able to get it exactly,
for example i write "sin(90*2)+sin(60)+sin(60+(75*2))+sin(50)+sin(20)" in textbox
i need "90*2,60,60+(75*2),50,20" as my out put
here is my code what i wrote ,please modify my code and help me

public class form1
Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click
Dim j As Integer = 0
Dim startPos As Integer

Dim parenCount As Integer = 1
Dim innerLen As Integer = 0
For j = 0 To TextBox1.Text.Length - 1
startPos = TextBox1.Text.IndexOf("sin(", j) + 4
For i As Integer = startPos To TextBox1.Text.Length

If TextBox1.Text(i) = "("c Then
parenCount = parenCount + 1
End If
If TextBox1.Text(i) = ")"c Then
parenCount = parenCount - 1
End If

If parenCount = 0 Then
Exit For
End If
innerLen = innerLen + 1

Next i
MsgBox(TextBox1.Text.Substring(startPos, innerLen))
Next j
End Sub
end class

Recommended Answers

All 3 Replies

please help me,it very urgent for me. my whole project struck here only

please help me out, its urgent

what is the problem, what is it producing and what did you expect
one thing you might like to look at is J is declared as an integer, IndexOf takes a int32 as a parameter, but it may not matter, VB may to the conversion for you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.