A problem in converting C code

Ali Çehreli acehreli at yahoo.com
Tue Nov 2 23:02:42 UTC 2021

On 11/2/21 3:57 PM, Ali Çehreli wrote:

Here is a more idiomatic version:

import std.stdio;
import std.string;

void main() {
   const x = strip(readln());

   if (x == "hello world!") {

The first line in main can be written with UFCS syntax as well:

   const x = readln.strip;


More information about the Digitalmars-d-learn mailing list