schönere möglichkeit?
-
Hi,
gibt es eine schönere Möglichkeit einen String mit einer bestimmten Anzahl von Leerzeichen zu füllen als diese?
string tab = ""; for (Int32 i = 0; i < 4; ++i) tab += " ";
String bietet leider keine Funktion al á "Fill (string, count)".
-
string tab = ""; tab = tab.PadLeft(4);
-
string tab = "".PadLeft(4);
-
odersogar schrieb:
string tab = "".PadLeft(4);
WTF?!
make my c# schrieb:
String bietet leider keine Funktion al á "Fill (string, count)".
Doch, tut sie, zumindest für 'char':
string tab = new string(' ', 4);