How to remove all characters from a string, except the integers?

matheus matheus at gmail.com
Fri Mar 4 22:06:09 UTC 2022


On Friday, 4 March 2022 at 20:38:11 UTC, ag0aep6g wrote:
> ...
> The second version involves auto-decoding, which isn't actually 
> needed. You can work around it with 
> `str.byCodeUnit.filter!...`. On my machine, times become the 
> same then.
>
> Typical output:
>
> str: 401296
> Tim(ms): 138
> Tim(us): 138505
>
> str: 401296
> Tim(ms): 137
> Tim(us): 137376

That's awesome my timing are pretty much like yours. In fact now 
with "byCodeUnit"  it's faster. :)

Thanks,

Matheus.


More information about the Digitalmars-d-learn mailing list