Hello Gurus..
How to get any char between "[" and "]" in TextBox1.Text?
Then transfer it into TextBox2.Text.
Thank You
Added green "resolved" checkmark - Hack
Printable View
Hello Gurus..
How to get any char between "[" and "]" in TextBox1.Text?
Then transfer it into TextBox2.Text.
Thank You
Added green "resolved" checkmark - Hack
Hi,
Insert a new form with two text box control and a command button and paste the following code in the code window:VB Code:
Private Sub Command1_Click() Dim intStart As Integer Dim intEnd As Integer intStart = InStr(1, Text1.Text, "[", vbTextCompare) intEnd = InStr(1, Text1.Text, "]", vbTextCompare) Text2.Text = Mid$(Text1.Text, intStart + 1, intEnd - intStart - 1) End Sub
VB Code:
Dim intLeft As Integer Dim intRight As Integer intLeft = InStr(Text1.Text, "[") intRight = InStrRev(Text1.Text, "]") Text2.Text = Mid$(Text1.Text, intLeft + 1, intRight - intLeft - 1)
Is there only one sequence of [ ] in the textbox, or might there be more than one?
There is only one set of [ and ]
Let say xxxxxx[yyyyyyyyy]zzzzzzzz
x,y and z is not fix count.
oopsss....both code can running well.
Thanks guys.