Using the replace operator on a string that has quotes powershell

后端 未结 3 1601
天命终不由人
天命终不由人 2021-01-19 00:44

I am looking to run the command

foreach-object {$_ -replace

However the string I am attempting to work with could be described as the follo

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 01:15

    You can Grave (the tilde key) double quotation marks as an escape character. You can do this to any special character in a string.

    e.g.

    $a = "This String `"Has`" Quotes"
    $a = $a.replace("This String `"Has`" Quotes","this string won't have quotes. ")
    

提交回复
热议问题