splitting file names using delimiter question RRS feed

  • Question

  • I have a very simple question. I am trying to set the variable $fnameYear to whatever is after the third '-'. My problem is that if there is a space in the name it wont work correctly. How can i use a delimeter so that it splits after the '-' for only 4 characters?

        $fnameYear=(($_.BaseName -split '-')[3])

    Wednesday, December 17, 2014 9:24 PM


All replies