On Thursday, 6 August 2020 at 07:24:23 UTC, WebFreak001 wrote:
On Thursday, 6 August 2020 at 07:19:37 UTC, WebFreak001 wrote:
[...]
In line 11 in my example code this makes a better, safer if
than `if (s.length)`:
if (s.length && s[$ - 1] == '\n') s = s[0 .. $ - 1];
Note that I only need
On Thursday, 6 August 2020 at 07:19:37 UTC, WebFreak001 wrote:
[...]
In line 11 in my example code this makes a better, safer if than
`if (s.length)`:
if (s.length && s[$ - 1] == '\n') s = s[0 .. $ - 1];
Note that I only need to do this because of the readln API, it
would be much safer and
On Wednesday, 5 August 2020 at 17:39:36 UTC, Mike Surette wrote:
In my efforts to learn D I am writing some code to read files
in different UTF encodings with the aim of having them end up
as UTF-8 internally. As a start I have the following code:
import std.stdio;
import std.file;
void main
In my efforts to learn D I am writing some code to read files in
different UTF encodings with the aim of having them end up as
UTF-8 internally. As a start I have the following code:
import std.stdio;
import std.file;
void main(string[] args)
{
if (args.length == 2)
{
if (args