Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell if string contains

$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'
}
 
PREVIOUS NEXT
Tagged: #powershell #string
ADD COMMENT
Topic
Name
5+3 =