How to split a JSON object into an array

I've got a JSON object that looks like this

Key1      = Value1
Key2      = Value2

This pattern continues x times, always

  • KeyName
  • Unknown length of whitespace
  • = character
  • Value
  • New line

If I JSON.Stringify I get

Key1      = Value1\nKey2     = Value2\nKey3      = Value3\n

How can I get an array along the lines of

{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"}

I'm not even sure how to Google what I need. Any pointers greatly appreciated.



from Recent Questions - Stack Overflow https://ift.tt/2KZHv06
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations