Function parse_string_to_letters

Source
pub fn parse_string_to_letters(s: &str) -> String
Expand description

Parse a string representing a full screen from a AoC puzzle.

Note: The current version will return all the characters it can parse, and ignore everyone that it cannot. To check individual characters, use the parse_letter function to parse them and get an Option<char>.

Example:


// Input is:
// ####.###....##.###..###..#..#..##..#..#.
// #....#..#....#.#..#.#..#.#.#..#..#.#..#.
// ###..#..#....#.###..#..#.##...#..#.####.
// #....###.....#.#..#.###..#.#..####.#..#.
// #....#....#..#.#..#.#.#..#.#..#..#.#..#.
// ####.#.....##..###..#..#.#..#.#..#.#..#.
let input = "####.###....##.###..###..#..#..##..#..#.\n#....#..#....#.#..#.#..#.#.#..#..#.#..#.\n###..#..#....#.###..#..#.##...#..#.####.\n#....###.....#.#..#.###..#.#..####.#..#.\n#....#....#..#.#..#.#.#..#.#..#..#.#..#.\n####.#.....##..###..#..#.#..#.#..#.#..#.";

assert_eq!(parse_string_to_letters(input), "EPJBRKAH");