Skip to content · ⁨コンテンツへスキップ⁩

Count the vowels · ⁨母音の数を数える⁩

English

Count the vowels

Count the vowels (a e i o u) in a String, treating upper- and lower-case the same. Lower-case it first with s.toLowerCase(), then loop with s.charAt(i) and compare against each vowel.

日本語

母音の数を数える

a e i o u (母音) の数を String 内で数えます。大文字と小文字は区別せず扱います。まず s.toLowerCase() で小文字にし、次に s.charAt(i) でループして各母音と比較します。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP