/// Removes all alphabetic characters (letters) from a given string,
/// leaving numbers, symbols, and whitespace intact.
///
/// This approach uses `Character.isLetter`, which provides full Unicode support
/// (handling accented characters, Cyrillic, etc., out of the box).
///
/// - Parameter input: The alphanumeric string to process.
/// - Returns: A new `String` with all letters removed.
func removeLetters(from input: String) -> String {
// filter keeps only the characters where isLetter is false
return input.filter { !$0.isLetter }
}
// --- Example Usage ---
let mixedString = "abc123XYZ456programming789"
let result = removeLetters(from: mixedString)
print(result)
/*
run:
123456789
*/