Escapes a src string using C‐style escapes sequences (https://en.cppreference.com/w/cpp/language/escape), escaping other non‐printable/non‐whitespace bytes as octal sequences (e.g. "377").
Synopsis
Declared in <absl/strings/escaping.h>
std::string
CEscape(std::string_view src);
Description
Example:
std::string s = "foorbartbaz010011012013014x0dn"; std::string escaped_s = absl::CEscape(s); EXPECT_EQ(escaped_s, "foo\rbar\tbaz\010\t\n\013\014\r\n");
Return Value
The escaped string.
Parameters
Name |
Description |
src |
The string to escape. |
Created with MrDocs