Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

String Format problem

$
0
0
Well I tried to return a string into the listbox, but the items doesn't align even.

This is my ToString, the three value is from getting value.
        public override string ToString()
        {
            return String.Format("{0,-25} {1,-7} {2,-1:F}", companyName, stock, date);
        }


Result on the listbox is
Publix         PUB   1/23/2003
Target Store      TS   1/23/2003


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>