Z
Z
Zhenia Bel2021-11-16 10:02:00
C++ / C#
Zhenia Bel, 2021-11-16 10:02:00

How to parse numbers for do while in windows form?

I need to parse n-number of numbers into a do while loop, through a textbox, can someone send an example of how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Davilkus Games, 2021-11-22
@Davilkus

If I understand correctly (you need to pull out one number and one string each)
Not ideal, but it will
do. Not tested, but something like this:
string[] nums = textBox1.text.Split(' ');
int counter = 0;
do {
int num = nums[counter];
// operations with num
counter++;
}
while (counter < nums.Length);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question