Answers for "powershell check if string contains a word"

1

powershell check if string contains a word

$strVal ='Hello world'
if($strVal -like '*World*') {
      Write-Host 'Your string contains the word world'
} else {
      Write-Host 'Your string does not contains the word world'
}
Posted by: Guest on January-21-2022

Code answers related to "powershell check if string contains a word"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language