10/23

Identify and print the capital, small, integers and symbols from the given string

Easy
Problem Statement
Given a string, identify and separate its characters into the following four categories:
  • Uppercase (capital) letters (A-Z)
  • Lowercase (small) letters (a-z)
  • Digits (0-9)
  • Special symbols (all other characters)
Print each category as a separate string while maintaining the original order of characters.
Input
A single string ri!userName.
Example Input:
"AppianVerse@$R9"
Output
Capital Letters: AVR
Small Letters: ppianerse
Digits: 9
Symbols: @$

ri! Rule Inputs

ri!userNameText
"AppianVerse@$R9"

Example 1 — Case 1

Input: ri!userName
"AppianVerse@$R9"
Output:
{
  "Capital Letters: AVR",
  "Small Letters: ppianerse",
  "Digits: 9",
  "Symbols: @$"
}

Example 2 — Case 2

Input: ri!userName
"Rappian$rocks @$07mk"
Output:
{
  "Capital Letters: R",
  "Small Letters: appianrocksmk",
  "Digits: 07",
  "Symbols: $ @$"
}

Example 3 — Case 3

Input: ri!userName
"@123#)@)#@KL"
Output:
{
  "Capital Letters: KL",
  "Small Letters: ",
  "Digits: 123",
  "Symbols: @#)@)#@"
}

Appian Expression Tips

  • • Use ri!variableName for rule inputs
  • • Use a!localVariables(local!x: …, body) for locals
  • • Use a!forEach(items: …, expression: fv!item) to iterate
  • • Use where() / reject(fn!isnull, list) to filter