**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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.