MCPcopy Create free account
hub / github.com/daisy/MathCAT / is_quoted_string

Function is_quoted_string

src/speech.rs:42–48  ·  view source on GitHub ↗

Checks the string to see if it is "quoted"

(str: &str)

Source from the content-addressed store, hash-verified

40
41/// Checks the string to see if it is "quoted"
42pub fn is_quoted_string(str: &str) -> bool {
43 if str.len() < N_BYTES_NO_EVAL_QUOTE_CHAR {
44 return false;
45 }
46 let bytes = str.as_bytes();
47 return bytes[bytes.len()-N_BYTES_NO_EVAL_QUOTE_CHAR..] == NO_EVAL_QUOTE_CHAR_AS_BYTES;
48}
49
50/// Converts 'string' into a "quoted" string -- use is_quoted_string and unquote_string
51/// IMPORTANT: this assumes the string is quoted -- no check is made

Callers 1

replace_charsMethod · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected