MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / json_escape

Method json_escape

core/string/ustring.cpp:4756–4768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4754}
4755
4756String String::json_escape() const {
4757 String escaped = *this;
4758 escaped = escaped.replace("\\", "\\\\");
4759 escaped = escaped.replace("\b", "\\b");
4760 escaped = escaped.replace("\f", "\\f");
4761 escaped = escaped.replace("\n", "\\n");
4762 escaped = escaped.replace("\r", "\\r");
4763 escaped = escaped.replace("\t", "\\t");
4764 escaped = escaped.replace("\v", "\\v");
4765 escaped = escaped.replace("\"", "\\\"");
4766
4767 return escaped;
4768}
4769
4770String String::xml_escape(bool p_escape_quotes) const {
4771 String str = *this;

Callers 3

_stringifyMethod · 0.80
_write_to_potMethod · 0.80
_write_msgidMethod · 0.80

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected