I Need a Human Readable, Yet Parse-able Document Format

后端 未结 5 1391
猫巷女王i
猫巷女王i 2021-02-05 08:50

I\'m working on one of those projects where there are a million better ways to accomplish what I need but I have no choice and I have to do it this way. Here it is:

Ther

5条回答
  •  长情又很酷
    2021-02-05 09:29

    I'm just gonna say that an INI string is pretty readable:

    Pet_Name = "Fred"
    

    But, you could always roll your own format. Something like:

    Key: ValueValueValueValueValueValue
    Key: ValueValue
    

    Basically, you would explode the string by newlines, look for text strings infront of colons and use that as the key, and the data after the colon and before the newline is the value.

提交回复
热议问题