Original Post
Sorry if this is in the wrong forum, but it's not directly related to games, so i thought I'd post it here. I'm writing a program in VB where the user inputs text with words combined with numbers, and adds together the numbers and outputs it to a text file. For Example, input could look like this (its just an example of the format, not what is actually going into the program): 3:30pm inventory is: *Swords: 34 *Guns: 22 *Cars: 5,732 5:20pm inventory is: *Swords: 24 *Guns: 53 *Cars: 3,344 I need my program to add up all of yesterdays and today's inventories. For example, the output would look like this: Total day's inventory is: *Swords: 58 *Guns: 75 *Cars: 9076 I have my program set up like this. There is a text box for the input (individual inventories) and a button "add" to add the two day's inputs together. Then, the program saves the output (total inventory) to a text file. I just can't figure out how to read only the numbers in the input. For example, getting the program to ignore the letters, asterisks and commas so it can assign each number to its own integer, allowing me to add the integers together to get the output. I know it would be easier if I just put in numbers for the input, but I'm designing this program to make it easy to calculate total "inventories", especially when there 50-100 daily inventories to add together. I designed it this way because I am copying and pasting the: "5:20pm inventory is: *Swords: 24 *Guns: 53 *Cars: 3,344" into the program, and there could be 50-100 of those a day, making it take much longer to just type the numbers in or copy and paste the numbers into the program individually. So basically, I need an easy way to sort of "extract" the integers from a string, ignoring all the letters and punctuation, so I can perform mathematical calculations on them. Sorry for the long post, I hope it's coherent enough to be understood :p. P.S. Please don't say anything like "why are you using VB". Right now, my experience with visual basic in this area is much greater than my experience with C++ and C#. Thanks again.