to delete the '\0' characters

Salih Dincer salihdb at
Sat Sep 24 04:47:38 UTC 2022

On Friday, 23 September 2022 at 22:17:51 UTC, Paul Backus wrote:
> Apologies for the confusion. You can use 
> [stripRight](

We have a saying: Estaghfirullah!

Thank you all so much because it has been very useful for me.

I learned two things:

* First, we can use strip() functions with parameters:

(examples are very nice)

* Second, we could walk through the string in reverse and with 

**Source Code:**
//import std.string : stripRight;/*
string stripRight(string str, const(char)[] chars)
   import std.string : indexOf;
   for (; !str.empty; str.popBack())
     if (chars.indexOf(str.back) == -1)
   return str;


SDB at 79

More information about the Digitalmars-d-learn mailing list