Ciao a tutti.
E' da qualche giorno che ci sbatto, mi servirebbe un contatore che anzicchè fare 1,2,3,4
inizi per 001,002,003,004,...., 010,011 etc etc come posso fare in C#
GRAZIE 1000!!!
Ciao a tutti.
E' da qualche giorno che ci sbatto, mi servirebbe un contatore che anzicchè fare 1,2,3,4
inizi per 001,002,003,004,...., 010,011 etc etc come posso fare in C#
GRAZIE 1000!!!
usa PadLeft(3, '0')
esempio :
codice:for(int i = 30;i>0;i--) { string numeroDaStampare = i.ToString().PadLeft(3,'0'); //ad ogni iterazione del ciclo : numeroDaStampare = 030 ; 029 ; 028 ... 009 ; 008 ecc. }
Tante ma tante grazie!
PROBLEMA RISOLTO!!!