Neeko
Neeko
Explore posts from servers
CC#
Created by Neeko on 3/4/2024 in #help
Parts of string to special json format
Hi, I need to transform array of string to a special json format. I don't know where to start to achieve this.
c#
foreach (var word in words) {
Console.WriteLine($"word = {word}");

// word = string of characters like :

// hello
// hello world
// hello world test
// world
// w (alias of world)
// ...
}
c#
foreach (var word in words) {
Console.WriteLine($"word = {word}");

// word = string of characters like :

// hello
// hello world
// hello world test
// world
// w (alias of world)
// ...
}
And I need to transform to json like this :
{
"hello": {
"world": {
"_usage": "hello world",
"test": {
"_usage": "hello world test"
}
}
},
"world": {
"_alias": "w",
"_usage": "(w)orld"
},
// etc ...
}
{
"hello": {
"world": {
"_usage": "hello world",
"test": {
"_usage": "hello world test"
}
}
},
"world": {
"_alias": "w",
"_usage": "(w)orld"
},
// etc ...
}
Thanks for you help!
2 replies