Split Operator: http://ss64.com/ps/split.html
Trim Operator: http://ss64.com/ps/trim.html
If you have a string and need to carve it up, you can use the .split() operator
Now what if you need to grab only the 2nd word in that string. By default the .split() operator will carve up the string by spaces.
To grab the 2nd word thus grab the word “HELPS” we can use the below. Remember the string starts at 0
This is all good but what if there was a space before or after the word “Helps” that we have now stored in our variable $SECONDWORD. To account for this we can add a little bit of extra code to ensure that all white spaces are removed.
Because we added .Trim() we will ensure that there are no white spaces.