end of day 4 week 1

This commit is contained in:
2026-01-22 07:31:44 +01:00
parent 5120f11339
commit 82b79336ea
15 changed files with 247 additions and 0 deletions

13
week 1/day 4/exo2.ps1 Normal file
View File

@@ -0,0 +1,13 @@
# exo 2
# return the number of character of a string only if they're letter
$text = Read-Host('please enter a phrase')
$counter = 0
foreach ($char in $text.ToCharArray()) {
if($char -match '[A-Za-z]'){
$counter++
}
}
Write-Host("your string contain ${counter} character")