On Saturday, 22 October 2022 at 22:01:09 UTC, Enjoys Math wrote:
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote:


string[] tokens = userSID.output.split!isWhite;
writeln("tokens = ", tokens); 

tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "S-1-5-21-3823976785-3597194045-4221507747-1779", "", "", "", "", "", "", "", ""]


Is there a clever way that I can discard all the extra null strings in the resultant string array?

I've been playing with isControl, whitespace, etc. Ready to rip my hair out.
        

Why not `strip`?  Works on ranges:
https://dlang.org/phobos/std_algorithm_mutation.html#.strip

Strip won't work because it only works on the beginning and ends of the range. What you want is `remove`. See my other MWE post.

Reply via email to