A practical example sanitizing user input by removing script tags and normalizing excess whitespace in a single pass.