Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Question on how to split a string based upon a pattern

$
0
0

I have string like this: 

    "Common-edi_rack_2.1-DEV"

 

I want to split it into the following two strings

  • Common-edi_rack
  • 2.1-DEV
I want to be able to split on the last occurrence of an "_" and not on an preceding.
How can I best accomplish this task?

Viewing all articles
Browse latest Browse all 8583

Trending Articles