CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

for a while

for (int i= 1; i < 10; i++)
   textBox1.Text+= i.ToString();

for (int i= textBox1.Text.Length; textBox1.Text.Length < 20; i++)
   textBox1.Text+= i.ToString();

for (;textBox1.Text.Length < 40;)
   textBox1.Text+= '#'
;

while (textBox1.Text.Length < 60)
   textBox1.Text+= '$';

The textbox (started as ++) will contain ++1234567891112131415###################$$$$$$$$$$$$$$$$$$$$ (what else).

Thanks to Frans on do while.

Peter

 

 



Check out Devlicio.us!

Our Sponsors

Free Tech Publications

This Blog

Syndication

News