-
January 30th, 2012, 07:25 AM
#1
how to get the al information from the brackets of each sin()
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
Code:
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
please help me
thanks in advance
Last edited by Cimperiali; January 30th, 2012 at 05:43 PM.
Reason: added code tags and indention
-
January 30th, 2012, 09:27 AM
#2
Re: how to get the al information from the brackets of each sin()
please help me its urgent
-
January 30th, 2012, 01:06 PM
#3
Re: how to get the al information from the brackets of each sin()
A few String.Replace() should work. Get rid of SIN, and the () for each, and add a . after each one
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|