RosettaCodeData/Task/Repeat-a-string/D/repeat-a-string-2.d

9 lines
210 B
D

import std.stdio;
void main() {
char[] chars; // create the dynamic array
chars.length = 5; // set the length
chars[] = '*'; // set all characters in the string to '*'
writeln(chars);
}