DEV Community

Discussion on: Daily Challenge #3 - Vowel Counter

Collapse
 
figueroadavid profile image
David Figueroa

Powershell

I do try to keep it as an actual function and give pretty/usable output.

function Get-VowelCount {
    param(
        [string]$InString
    )

    [pscustomobject]@{
        String              = $InString
        LowerCaseCount = [regex]::Matches($InString,'[aeiou]').Count
        UpperCaseCount = [regex]::Matches($InString, '[AEIOU]').count
    }
}