ec_str_quote - Man Page
Quote a string, escaping nested quotes.
Synopsis
#include <ecoli/string.h>
char * ec_str_quote(
const char *str, /* The string to quote. */
/*
* The quote character to use: usually " or ' but can be anything. If 0,
* select between " or ' automatically.
*/
char quote,
/*
* If true, always add quotes, else add them only if the string contains
* spaces or quotes.
*/
bool force
);Return Value
An allocated string, that must be freed by the caller using free().
See Also
ec_str_parse_llint(3), ec_str_startswith(3), ec_str_is_space(3), ec_strcmp_count(3), ec_str_parse_ullint(3), ec_str_wrap(3)
Copyright
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
Referenced By
ec_strcmp_count(3), ec_str_is_space(3), ec_str_parse_llint(3), ec_str_parse_ullint(3), ec_str_startswith(3), ec_str_wrap(3).
2026-06-11 Libecoli Programmer's Manual