On Sunday, 30 October 2016 at 20:50:47 UTC, Alfred Newman wrote:
Hello,
I'm migrating some Python code to D, but I stuck at a dead
end...
Sorry to provide some .py lines over here, but I got some
doubts about the best (fastest) way to do that in D.
Executing the function parsertoken("_My input.string", "
_,.", 2) will result "input".
Parsercount("Dlang=-rocks!", " =-") will result 2,
Thanks in advance
You can take inspiration from the following snippet:
=============================================
import std.stdio, std.regex;
void main()
{
string s = "Hello.World !";
auto ss = split(s, regex(`\.| `));
ss.length.writeln;
ss[1].writeln;
}
=============================================