Answer
CODE:
a!forEach(
items:code("AdhGy123@"),
expression:expression: if(
and(
fv!item >= 0,
fv!item <= 9
),
fv!item & " is number",
if(
and(
fv!item >= 97,
fv!item <= 122
),
char(fv!item) & " is Small",
if(
and(
fv!item >= 65,
fv!item <= 90
),
char(fv!item) & " is cap",
char(fv!item) & " is sybmol"
)
)
)
Result:
{"A is cap", "d is Small", "h is Small", "G is cap", "y is Small", "1 is number", "2 is number", "3 is number", "@ is symbol"}
Explanation:
1.code("AdhGy123@") --it will split the string into list of numbers for alphabets (like 65,66,67,.......)
2. and (fv!item >= 0, fv!item <= 9) -- it will check whether the number is in 0-9 and print as integer
3.and (fv!item >= 97, fv!item <= 122) -- it will check whether the number is in 97-122 because captial letters value starts from this range and print as Capital letters
4and(fv!item >= 65, fv!item <= 90) -- it will check whether the number is in 65-90 because small letters value starts from this range and print as integer