SWT301_-_FALL24_-_PE4_3276.webp
fragrant_flower

SWT301_-_FALL24_-_PE4_3276.webp

numeric characters, and special characters in a given input string. It returns a HashMap
containing this information.
1
2
import java.util.HashMap;
public class Character Counter {
3@
4
5
6
7
8
9
10
11
12
13
14
public static HashMap<String, Integer> countCharacters(String input) {
int upperCaseCount = 0;
int lowerCaseCount = 0;
int numericCount = 0;
int specialCharCount = 0;
for (char c input.toCharArray()) {
if (Character.isUpperCase(c)) {
upper CaseCount++;
} else if (Character.isLowerCase(c)) {
lower CaseCount++;
} else if (Character.isDigit(c)) {
Zoom
+ 100%
Close

Thông tin

Category
SWT301
Thêm bởi
fragrant_flower
Ngày thêm
Lượt xem
9,360
Lượt bình luận
2
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
SWT301_-_FALL24_-_PE4_3276.webp
File size
152.4 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom