Link to home
Start Free TrialLog in
Avatar of DevSupport
DevSupport

asked on

splitting or cropping a variable value in powershell

Hi Experts,

In powershell I have a variable which has value

$var=C:\Tomcat8032_app\apache-tomcat\bin\tomcat8.exe //RS//dsupgdev

I want to crop this string and store the value to another variable such that I want only the values until 3rd backslash "\"

$new-var=C:\Tomcat8032_app\apache-tomcat\

Could you please help me with this?
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DevSupport
DevSupport

ASKER

Thank You Shaun!!
Anytime, happy to help

Please remember to Endorse my, or any other expert's, comment that you found helpful.