On 10/22/22 5:53 PM, WhatMeWorry wrote:
string[] tokens = userSID.output.split!isWhite;
writeln("tokens = ", tokens);
tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote:
string[] tokens = userSID.output.split!isWhite;
writeln("tokens = ", tokens);
[...]
Is there a clever way that I can discard all the extra null
strings in the resultant string array?
Easiest way is to use [`filter`][1]. Here'
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", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", ""
__MWE Code:__
```
module DlangForumsMWE;
import std.stdio;
import std.algorithm.mutation;
int main()
{
//string[] tokens = userSID.output.split!isWhite;
//writeln("tokens = ", tokens);
auto tokens = ["SID", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", ""
On 10/22/22 14:53, WhatMeWorry wrote:
>
>
> string[] tokens = userSID.output.split!isWhite;
> writeln("tokens = ", tokens);
Could you please show minimal compilable code that demonstrates the
issue. I spent some time with some guesses but failed (to get my code to
compile with std.array.split).
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote:
string[] tokens = userSID.output.split!isWhite;
writeln("tokens = ", tokens);
tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "",
string[] tokens = userSID.output.split!isWhite;
writeln("tokens = ", tokens);
tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "S-1-5-