代码片段管理工具:rofi前端+Java守护进程
This commit is contained in:
8
test/data-test.json
Normal file
8
test/data-test.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"action": "ADD",
|
||||
"data": {
|
||||
"name": "ExtractJSON",
|
||||
"language": "Java",
|
||||
"content": "public static String extractJson(String jsonStr) {\n jsonStr = jsonStr.replace(\"“\", \"\\\"\").replace(\"”\", \"\\\"\");\n int start = jsonStr.indexOf(\"{\");\n int end = jsonStr.lastIndexOf(\"}\");\n if (start != -1 && end != -1 && start < end) {\n return jsonStr.substring(start, end + 1);\n }\n return jsonStr;\n}"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user