Reputation: 35
I have a URL from which I need to extract a text. The URL is of the form:
abcd.com/File1/00012121
abcd.com/File12/00012121
abcd.com/File123/00012121
I need to extract File1, File12 and File123 respectively.
Upvotes: 0
Views: 187
Reputation: 14695
You could try something like this:
('abcd.com/File1/00012121' -split '/')[1]
Or:
'bcd.com/File1/00012121' -split '/' | Select -First 1 -Skip 1
Upvotes: 1