Hello,
Is there a better way to transform a string array to a tuple or
to an AliasSeq?
```
mixin(customSyntaxPrefixes.format!`tuple(%(%s,%))`)
```
I'd like to use this as variable length arguments passed to the
startsWith() std function (as multiple needles).
On Sunday, 19 February 2023 at 11:08:34 UTC, realhet wrote:
Is there a better way to transform a string array to a tuple or
to an AliasSeq?
```
mixin(customSyntaxPrefixes.format!`tuple(%(%s,%))`)
```
https://dlang.org/phobos/std_meta.html#aliasSeqOf
On Sun, Feb 19, 2023 at 11:08:34AM +, realhet via Digitalmars-d-learn wrote:
> Hello,
>
> Is there a better way to transform a string array to a tuple or to an
> AliasSeq?
>
> ```
> mixin(customSyntaxPrefixes.format!`tuple(%(%s,%))`)
> ```
>
> I'd like to use this as variable length argument
Awesome, Thank both of you!
```
enum a = ["A", "B"];
writeln(a);
writeln(aliasSeqOf!a);
writeln([aliasSeqOf!a]);
```