Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルを読み取るスキャナーを作成しましたが、母音と文字/数字の数え方がわかりません。for ループで .chartAt(i) を使用したいのですが、 Scanner クラスで .charAt() を使用できません。この問題にどう対処するか興味があります
これはアルファ数値をカウントします:
int alphaNumericCount = input.split("(?<=[A-Za-z0-9])").length - 1;
これは母音を数えます:
int vowelCount = input.split("(?<=[AEIOUaeiou])").length - 1;
ファイルの読み取り方法はあなた次第です。