This method should take in a string, and return true
if it is all zeros or false
if there is at least one other character in the string:
Function check0ID($fixedString) {
foreach ($char in $fixedString) {
If ($char -ne "0") {
$false
}
}
$true
}
This method will return:
false
true
even when the string is not all zeros. Why doesn't this method stop after returning $false
? NB If you want to give a more efficient method with the same functionality, please do :)