Select all words from string except last (PowerShell)

Question:

So what I am trying to achieve is selecting all words from a given string, except the last one.
So I have a few strings;

I want to select all words, except the last one from every string.
I figured out I could use split() to take every word as separate. Though I can’t figure it out any further.

Thanks in advance.

Answer:

Here’s how I might do something like this.

Source:

Select all words from string except last (PowerShell) by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply