If I build and run the attached program I get
Method 1:
{Monday }
{Tuesday }
{Wednesday}
{Thursday }
{Friday }
{Saturday }
{Sunday }
but I don't understand why. I'd have thought that it should be
Method 1:
{Monday}
{Tuesday}
{Wednesday}
{Thursday}
{Friday}
{Saturday}
{Sunday}
which I can get by using trim(n) on line 22. Could someone please explain to me why I get the first result. Thanks.