On Monday, 20 April 2015 at 17:16:21 UTC, Ivan Kazmenko wrote:
writeln(wrap(a, 30, ";; ", ";; "));
Works with dmd 2.066.1 and 2.067.0.
Thanks.
Yes, it's a lot better but I did not get to concatenate the
string ";;" in each paragraph:
-
import std.conv, std.stdio, std.range, std.string;
void main() {
auto a = iota(10, 1101).text;
a = a[1 .. $ - 1], a ~= '.';
writeln(wrap(a, 30));
}
-
http://ideone.com
On Friday, 17 April 2015 at 09:25:43 UTC, Ivan Kazmenko wrote:
On Saturday, 11 April 2015 at 22:45:39 UTC, Dennis Ritchie
wrote:
I also want to know whether it is possible to D somehow set
the maximum width of the print string in characters?
-
void main() {
import std.stdio, std.ra
On Saturday, 11 April 2015 at 22:45:39 UTC, Dennis Ritchie wrote:
I also want to know whether it is possible to D somehow set the
maximum width of the print string in characters?
-
void main() {
import std.stdio, std.range;
writefln(";; %(%s, %)).", iota(10, 1101));
}
-
On Saturday, 11 April 2015 at 22:45:39 UTC, Dennis Ritchie wrote:
I also want to know whether it is possible to D somehow set the
maximum width of the print string in characters?
I got to do this:
-
import std.stdio, std.range, std.conv, std.array;
void formatWidthIotaToStr(ref string for
I also want to know whether it is possible to D somehow set the
maximum width of the print string in characters?
-
void main() {
import std.stdio, std.range;
writefln(";; %(%s, %)).", iota(10, 1101));
}
-
For example, here's the code to Common Lisp which is given by the
On Saturday, 11 April 2015 at 20:37:17 UTC, anonymous wrote:
On Saturday, 11 April 2015 at 20:10:49 UTC, Dennis Ritchie
wrote:
writefln("%(;; %(%s, %),\n%).", [
a[0 .. 15],
a[15 .. 30],
a[30 .. 45],
a[45 .. 60],
On Saturday, 11 April 2015 at 20:10:49 UTC, Dennis Ritchie wrote:
writefln("%(;; %(%s, %),\n%).", [
a[0 .. 15],
a[15 .. 30],
a[30 .. 45],
a[45 .. 60],
a[60 .. 75],
a[75 .. 90],
Hi,
Is it possible to write somehow shorter using formatted output
and other library functions?
-
import std.stdio, std.range;
void main() {
auto a = iota(100, 201);
writefln("%(;; %(%s, %),\n%).", [
a[0 .. 15],
a[15 .. 30],