Checks if a given string has control characters.
(s: &str)
| 411 | |
| 412 | /// Checks if a given string has control characters. |
| 413 | pub fn has_control_chars(s: &str) -> bool { |
| 414 | for ch in s.chars() { |
| 415 | if ch.is_control() { |
| 416 | return true; |
| 417 | } |
| 418 | } |
| 419 | false |
| 420 | } |
| 421 | |
| 422 | /// Removes control characters from a string to make it suitable for printing. |
| 423 | pub fn remove_control_chars<S: Into<String>>(s: S) -> String { |
no test coverage detected