non-zero when the loop was exited through a break
void main() { string str; wtring wstr; dstring dstr; foreach (dchar c; str) {} // _aApplycd1 foreach (wchar c; dstr) {} // _aApplydw1 foreach (i, wchar c; str) {} // _aApplycw2 foreach (wchar w; wstr) {} // no conversion }
Loop over a string while changing the UTF encoding
There are 6 combinations of conversions between char, wchar, and dchar, and 2 of each of those.
The naming convention is as follows:
_aApply{c,d,w}{c,d,w}{1,2}
The first letter corresponds to the input string encoding, and the second letter corresponds to the target character type.
- c = char - w = wchar - d = dchar
The 1 variant only produces the character, the 2 variant also produces a loop index.