I have a string which looks something like this:
"Comments : @{id=15161772,we are happy with the service,likes=&÷€$:#,hsbdinsjsonsjbdjdjid}"
I would like to get the part "We are happy with the service".
I have tried something like:
$string ="Comments : @{id=15161772,we are happy with the service,likes=&÷€$:#,hsbdinsjsonsjbdjdjid}"
$string.split(",") | foreach {if(($_ -Notlike "*id=*" ) -and ($_ -Notlike "*likes=*")){$_ }}
I get the result as:
We are happy with the service
hsbdinsjsonsjbdjdjid
I wish to only get "we are happy with the service".