Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | khaylaaaa |
For instance, I would need to process the array to find both the min and max numbers in a list of integers that the user inputs into a text edit. Thanks!
So, a User will type a single string into a TextEdit
control, consisting of integers separated by commas (and possibly spaces?) and you want to find the min and max integer values in that string?
For example, your string might look like this?
52, 27, 16,44,19, 55, 122
Is that correct? Much of the difficulty with string parsing is understanding the possible content of the target string. For example, will all values be separated by commas, or might they also just be separated by spaces? Could there be multiple commas between consecutive values? Can there be multiple spaces? Can the spaces be missing or are they required?
Please provide some examples of the expected string contents.
On the surface, I assume this is likely a good candidate for some regex
parsing…
jgodfrey | 2022-12-05 23:11