On Wednesday, 8 December 2021 at 12:49:39 UTC, Adam D Ruppe wrote:
On Wednesday, 8 December 2021 at 11:23:45 UTC, BoQsc wrote:
The string example to loop/iterate:

foreach(ch; a) {

}

does the individual chars of the string you can also

foreach(dchar ch; a) {

}

to decode the utf 8

Thanks Adam.

This is how it would look implemented.

```
import std.stdio;

void main()
{
    string a = "abc;def;ab";
        string b;
        
        foreach(ch; a) {
                if (ch != ';'){
                        b ~= ch;
                }
        
                writeln(ch);
        }
        
    writeln(b);
}
```

Reply via email to