MCPcopy Index your code
hub / github.com/endbasic/endbasic / has_control_chars

Function has_control_chars

std/src/console/mod.rs:413–420  ·  view source on GitHub ↗

Checks if a given string has control characters.

(s: &str)

Source from the content-addressed store, hash-verified

411
412/// Checks if a given string has control characters.
413pub 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.
423pub fn remove_control_chars<S: Into<String>>(s: S) -> String {

Callers 1

remove_control_charsFunction · 0.85

Calls 1

charsMethod · 0.80

Tested by

no test coverage detected