When developing VB programming, a string of numbers entered in the form is split into single numbers. How to edit it? Let’s take a look at the detailed tutorial below.
1. First, insert two text box controls in the editing area and name them Text1 and Text2.
2. Next, insert a button control.
3. In the code, define two string variables str and res to save the number before splitting and the number after splitting.
4. Then, define the variable arr and its value.
5. Enter the value of the string str and obtain it using the Text method.
6. Get the value of arr(1) using the Mid method.
7. Split all the numbers in the string str, and save the split numbers in the variable arr.
8. Use the For statement to control and read the value in the variable arr.
9. Save each split value in the variable res.
10. Finally, output each split value in the window, separated by spaces.
11. Run the program, enter a string of numbers into the cell, and it will be split into single numbers.
The above is a tutorial on splitting a string of numbers entered into a VB6.0 form into single numbers. I hope you like it, and please continue to pay attention to the new webmaster website.
Related recommendations:
How to use VB6.0 label box?
How to quickly delete txt contents in batches in VB6.0?