07-21-2023, 03:02 PM
I would like to split a string witch has a variable whitespace characters, but a get a lot of empty lines which I would like to eliminate.
this code
$text = "Video Video Audio Audio VBI VBI"
$text.Split()
outputs this
Video
Video
Audio
Audio
VBI
VBI
PS H:\>
and I would like this
Video
Video
Audio
Audio
VBI
VBI
**Very late edit:**
Noticed this question is still getting a lot of views, so I would like to clarify that I had no knowledge of Functional Programming or Regular Expressions when I asked this question.
All the solutions mentioned here apply as there are multiple ways to remove whitespace and create an array from a string.
this code
$text = "Video Video Audio Audio VBI VBI"
$text.Split()
outputs this
Video
Video
Audio
Audio
VBI
VBI
PS H:\>
and I would like this
Video
Video
Audio
Audio
VBI
VBI
**Very late edit:**
Noticed this question is still getting a lot of views, so I would like to clarify that I had no knowledge of Functional Programming or Regular Expressions when I asked this question.
All the solutions mentioned here apply as there are multiple ways to remove whitespace and create an array from a string.