I'm making an application which searches all the lines of my text files in a directory, and writes the specific search match to my output box. The only problem is I need to split a string like this:

character-item = 0	996	1500000

How it works:

You search for the Item Id, in this case it's 996.

I need to spit it into two parts, the 996 is the Item ID, and the 1500000 is the amount.

How would I do this?

(The id and amount is differs, depends on what I search for.)

Recommended Answers

All 2 Replies

I'm making an application which searches all the lines of my text files in a directory, and writes the specific search match to my output box. The only problem is I need to split a string like this:

character-item = 0	996	1500000

How it works:

You search for the Item Id, in this case it's 996.

I need to spit it into two parts, the 996 is the Item ID, and the 1500000 is the amount.

How would I do this?

(The id and amount is differs, depends on what I search for.)

Not having the advantage of seeing what your incoming data looks like, I can only point you to the STRING.SUBSTRING() method to pull out the data you want from an incoming string, and the STRING.TRIM() method to clean up what you pull out (if you input string is formatted with spaces).

Cool, I did it. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.