中重新格式化JSON

中重新格式化JSON

本文介绍了如何在Notepad ++中重新格式化JSON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我需要Notepad ++从中获取一个json字符串

I need Notepad++ to take a json string from this

{"menu": {"id": "file","value": "File","popup": {"menuitem": [{"value": "New", "onclick": "CreateNewDoc()"},{"value": "Open", "onclick": "OpenDoc()"},{"value": "Close", "onclick": "CloseDoc()"}]}}}

对此...

{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}

我环顾了所有的TextFX选项,但找不到任何有效的方法.

I looked around at all the TextFX options but couldn't find anything that worked.

推荐答案

安装

http://sourceforge.net/projects/jsminnpp/下载并复制JSMinNpp. dll到记事本++的插件目录.或者,您也可以从记事本++中的插件管理器中安装"JSTool".

Download it from http://sourceforge.net/projects/jsminnpp/ and copy JSMinNpp.dll to plugin directory of Notepad++. Or you can just install "JSTool" from Plugin Manager in Notepad++.

新安装了Notepad ++,PluginManager去了哪里?请参阅如何在Notepad ++中查看插件管理器

New Notepad++ install and where did PluginManager go? See How to view Plugin Manager in Notepad++

{
  "menu" : {
    "id" : "file",
    "value" : "File",
    "popup" : {
      "menuitem" : [{
      "value" : "New",
          "onclick" : "CreateNewDoc()"
        }, {
          "value" : "Open",
          "onclick" : "OpenDoc()"
        }, {
          "value" : "Close",
          "onclick" : "CloseDoc()"
        }
      ]
    }
  }
}

提示:选择要重新格式化的代码,然后选择插件" JSTool | JSFormat.

Tip: Select the code you want to reformat, then Plugins | JSTool | JSFormat.

这篇关于如何在Notepad ++中重新格式化JSON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 21:17