Nows as good a time as any to learn to use the debugger.

Your last line will print 2 too many '-' chars. Why? How do you fix it?

Follow your code in a debugger, set breakpoints, add variables to the watch window and work out why this happens and how to effect a fix.