“PowerShell jika string berisi” Kode Jawaban

PowerShell jika string berisi

$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'
}
CyberSimon

PowerShell String berisi

PS C:\> "abc", "def" -Contains "def"
True

PS C:\> "Windows", "PowerShell" -Contains "Shell"
False  #Not an exact match
Crazy Cod

PowerShell jika string berisi

$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'
}
CyberSimon

Jawaban yang mirip dengan “PowerShell jika string berisi”

Pertanyaan yang mirip dengan “PowerShell jika string berisi”

Lebih banyak jawaban terkait untuk “PowerShell jika string berisi” di Shell/Bash

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya