I have certain strings as given below
PS C:\Users> $S1="PS CUT (ZIP ONLY), ALWAYS chose for MARTIO"
PS C:\Users> $s2="ZINO-IAS CUT"
PS C:\Users> $s3="ZINO-IPS CUT 2"
PS C:\Users> $s4="ZINO-IAS CUT4"
PS C:\Users> $s5="ZINO-IPS"
I want to replace above strings from the word CUT itself as given below
PS
ZINO-IAS
ZINO-IPS2
ZINO-IAS4
ZINO-IPS
Plase not that if there is a number after word CUT we are not removing that.
i tried the following code but it doesn't worked
PS C:\Users> $s5 -replace "CUT\s*\w*",""