View source code
Display the source code in rt/aApply.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Function rt.aApply._aApplycd1
Loop over a string while changing the UTF encoding
{null} _aApplycd1();
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.
Examples
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
}
Parameters
Name | Description |
---|---|
aa | input string |
dg | foreach body transformed into a delegate, similar to opApply |
Returns
non-zero when the loop was exited through a break
Authors
Walter Bright
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.