Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

String manipulation

$
0
0

I have a multiple rows of strings with comas where they're really one String object.

word1,juice,brick,argon

word2,cola,stone,air

I would need removing the first word in each line together with the coma character. Then I only need the liquids and solids giving them labels accordingly. How can this be achieved?

Update: I'm managing to get rid of the first word in probably a bit nasty way

$words = $words | foreach {($_.substring($_.IndexOf(",")+1))}

where $words is my String object. Now need to get rid of the gas names.


Viewing all articles
Browse latest Browse all 6937

Trending Articles