Re: a function like writeln that returns a string rather than writes to a file

2020-05-02 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 10:36:47 UTC, Ali Çehreli wrote: On 5/1/20 7:40 PM, dan wrote:> On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: >> On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn >> wrote: >>> I'm looking for a function something like writeln or write,

Re: a function like writeln that returns a string rather than writes to a file

2020-05-02 Thread Ali Çehreli via Digitalmars-d-learn
On 5/1/20 7:40 PM, dan wrote:> On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: >> On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn >> wrote: >>> I'm looking for a function something like writeln or write, but >>> instead of writing to stdout, it writes to a string

Re: a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 02:49:04 UTC, Steven Schveighoffer wrote: On 5/1/20 10:40 PM, dan wrote: On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn wrote: [...] [...] import std.format : format; string s

Re: a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/1/20 10:40 PM, dan wrote: On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn wrote: I'm looking for a function something like writeln or write, but instead of writing to stdout, it writes to a string and returns

Re: a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn wrote: I'm looking for a function something like writeln or write, but instead of writing to stdout, it writes to a string and returns the string. [...] imp

Re: a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn wrote: > I'm looking for a function something like writeln or write, but instead of > writing to stdout, it writes to a string and returns the string. [...] import std.format : format; string str = format("%s %s