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 string example to loop/iterate: ``` import std.stdio; void main() { string a="abc;def;ab"; } ``` The character I want to skip: `;` Expected result: ``` abcdefab ```
import std.stdio : writeln; import std.algorithm.iteration : filter; import std.conv : to; void main() { string a = "abc;def;ab"; string b = a.filter!(c => c != ';').to!string; writeln(b); }