https://d.puremagic.com/issues/show_bug.cgi?id=12348
Summary: toImpl(Target,Source)(Source source, radix) add range
support
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Daniel Kozak <[email protected]> 2014-03-11 09:04:12 PDT ---
Few days ago I need convert ascii7 binary string into chars.
For example something like this:
string str = "10101011010101"; // contains "UU"
So my first attempt has been something like this:
foreach(chunk; str.chunks(7)) {
write(to!char(chunk,2));
}
It doesn't work.
But this works ok:
foreach(chunk; str.chunks(7)) {
write(to!char(to!ubyte(to!string(chunk), 2))); // but seems ugly
//write(to!char(parse!ubyte(chunk, 2))); //this works too but still not
perfect
}
It would be great if the code from my first attempt works
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------