0

Hello,
I want to add integer value in specify integer from mix character TextBox,

For eg, I have two TextBoxes first's name Textbox1 and second's name Textresult1

Textbox1.Text = "blabla 2 bla"

Now after a empty space and before a empty space i want to + 1 in integer value and it'll show in Textresult1 like this "blabla 3 bla"

Please Help.. Explain the full code for this, Thanks

Edited by Nick Evan: removed bb-tags

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by vb5prgrmr
0

Look at the split function and dynamic arrays. Also, see the val function and the join function...

Dim MyDynamicArray() As String
MyDynamicArray = Split(Text1.Text, " ")
MyDynamicArray(1) = CStr(Val(MyDynamicArray(1)) + 1)
Text2.Text = Join(MyDynamicArray, " ")

You also may want to look at IsNumeric to make your code more flexible.

Good Luck

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.