How to loop through characters of a string in D language?

Arjan arjan at ask.me.to
Fri Dec 10 22:35:58 UTC 2021


On Friday, 10 December 2021 at 06:24:27 UTC, Rumbu wrote:
> On Wednesday, 8 December 2021 at 11:23:45 UTC, BoQsc wrote:
>> Let's say I want to skip characters and build a new string.
>> The character I want to skip: `;`
>>
>> Expected result:
>> ```
>> abcdefab
>> ```
>
> Since it seems there is a contest here:
>
> ```d
> "abc;def;ghi".split(';').join();
> ```
>
> :)
```d
"abc;def;ghi".tr(";", "", "d" );
```



More information about the Digitalmars-d-learn mailing list