fix clean json response

This commit is contained in:
2026-07-03 12:24:40 +07:00
parent 8a4e882dc1
commit 08f19f17a2
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
name = "GeneralUtils"
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
version = "0.4.4"
version = "0.4.5"
authors = ["tonaerospace <tonaerospace.etc@gmail.com>"]
[deps]
+6 -4
View File
@@ -545,10 +545,12 @@ julia> clean_json_response(text)
```
"""
function clean_json_response(text::String)
text = replace(text, '{' => "")
text = replace(text, '}' => "")
text = replace(text, "```" => "")
text = replace(text, "json" => "")
removelist = ["{", "}", "```", "json"]
for i in removelist
while occursin(i, text)
text = replace(text, i => "")
end
end
text = '{' * text * '}'
return text
end