JSON和Properties互轉

JSON和Properties互轉

JSON和Properties互轉是一種易於使用的工具,可將JSON轉換為Properties,Properties轉JSON。複製、貼上並轉換。

它提供以下工具:

  1. 線上從JSON字串生成Properties(json轉Properties)。
  2. 線上從Properties生成JSON字串(Properties轉json)。

如何使用JSON和Properties互轉?

  1. 在上方的文字區域欄位中寫入或貼上您的json/Properties字串。
  2. 點擊「JSON轉Properties」按鈕以生成您的Properties程式碼。或者點擊「Properties轉JSON」按鈕生成您的JSON程式碼。
  3. 點擊「複製」按鈕貼到剪貼簿,也可以下載結果檔案。

將JSON字串轉換為Properties範例

輸入JSON字串

{
"id":1,
"name":"John",
"age":24,
"db":{
"tyle":"mysql",
"host":"127.0.0.1",
"port":3306,
"username":"root",
"password":"root"
} 

輸出Properties結果:

id=1
name=John
age=24
db.tyle=mysql
db.host=127.0.0.1
db.port=3306
db.username=root
db.password=root