Hello all, I am currently using VB 2010 and am having a problem comparing strings in my program. My problem is that i need to output a line between each set of employees every time the name changes, in a list box.

For example:

My current output is:

James
James
James
James
Chuck
Chuck
Sandy
Sandy
Sandy
Sandy

I want to create a line between each change of name such as:


James
James
James
James
-------------
Chuck
Chuck
--------------
Sandy
Sandy
Sandy
Sandy

Should I use an if statement to compare the first letter in each string? Also, each name is read in from a text file.

never mind..i figured it out..how do i delete this post?

Try posting your solution and marking that post as answer.

post the solution and just mark the post as solved

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.