0

I found this snippet for doing a string to array:

$c = "2,3,4,5,6,7,10..12".split(',') | % {iex $_}

How would I do the reverse to convert $c back to a string like "2,3,4,5,6,7,10,11,12"? I of course don't require to abbreviate it back to "2..7,10..12".

0

1 Answer 1

1

You are looking for -join:

$c -join ','
Sign up to request clarification or add additional context in comments.

1 Comment

Ah! As simple as that, I was making it harder than it need be.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.