**How am I going to split a line of strings ang put it into an array if the strings are arranged into columns, just like the attached file
then compare the first column with user's input..? **

Recommended Answers

Use the String split method with a comma as the split character to separate the strings into a String array, then use trim() on each string to get rid of leading and/or trailing blanks as required.

Or, if you're a regex black-belt you could define the separator string as <any …

Jump to Post

All 2 Replies

Use the String split method with a comma as the split character to separate the strings into a String array, then use trim() on each string to get rid of leading and/or trailing blanks as required.

Or, if you're a regex black-belt you could define the separator string as <any amount of white space><comma><any amount of white space> and do the whole job in one step.

.i used your first suggestion, and thank you so much for the reply, its a great help :)

Be a part of the DaniWeb community

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