June 29, 2020 at 11:52 am #238949ParticipantTopics: 3Replies: 3Points: 33Rank: Member
I have variable $path. It contains more than 2 paths like:
I need to trim $path (last *.txt) to : (expectenced)
Does anyone have ane idea how to trim it?
June 29, 2020 at 12:16 pm #238964
June 29, 2020 at 12:33 pm #238970ParticipantTopics: 3Replies: 3Points: 33Rank: Member
Yes I treid. I was focused to manipulation text with split, splitend and indexof. i did’n knwo split-path cmdlet
June 30, 2020 at 4:11 pm #239303ParticipantTopics: 9Replies: 10Points: 47Rank: Member
or you could use both split and trim like:
June 30, 2020 at 4:46 pm #239312ParticipantTopics: 5Replies: 2372Points: 6,005Rank: Community MVP
or you could use both split and trim like
I’m afraid the
.trim()method does not work like you think it does. Try the following snippet. It might help you to understand
'trim specified charachters'.trim('srthcae')
June 30, 2020 at 4:55 pm #239327ParticipantTopics: 0Replies: 10Points: 108Rank: Participant
Split-Pathcommand. Of course since your original variable is an array of paths you will need to iterate through that array and run the
Split-Pathon each element of the array.
- You must be logged in to reply to this topic.