On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I've looked around and it seems using regex is the only closest solution.
I'm a simple man who uses D with the old C mentality: import std.stdio; void main(){ string s, str = "4A0B1de!2C9~6"; foreach(i;str){ if(i < '0' || i > '9'){ continue; } s ~= i; } writeln("Result: ", s); } Result: 401296 Matheus.