diff options
Diffstat (limited to 'src/string_utils.hh')
| -rw-r--r-- | src/string_utils.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/string_utils.hh b/src/string_utils.hh index 61a28cad..558ba62f 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -128,9 +128,11 @@ StringView format_to(ArrayView<char> buffer, StringView fmt, Types&&... params) return format_to(buffer, fmt, ArrayView<const StringView>{detail::format_param(std::forward<Types>(params))...}); } +String double_up(StringView s, StringView characters); + inline String quote(StringView s) { - return format("'{}'", replace(s, "'", "''")); + return format("'{}'", double_up(s, "'")); } } |
