Skip to main content

escape_c_like_string

Function escape_c_like_string 

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

Escapes a string literal for C11, C++20, ObjC++, Rust, and Swift double-quoted literals.

Escaping \ -> \\ also prevents Swift \(...) string interpolation.