sunjw / jstoolnpp

A JavaScript (JSON) tool for Notepad++ (formerly JSMinNpp) and Visual Studio Code.
GNU General Public License v2.0
283 stars 24 forks source link

Can I Get The Code To Format Json In C# Please? #153

Closed SalmaBegumJSR closed 5 months ago

SalmaBegumJSR commented 5 months ago

Greetings,

first i must beg you to post a request, in a issue section, because i am very new to github, and i don't know where to ask for that kind of request.

now.. i really like the function that you did in that notepad++ plugin. which format the json code very nicely. I want to use that code/algorithm to format my json data in my program as well.

but the issue is, i am c# developer, and i do have zero knowledge on c++..

so, you or anyone? can give me the code in c# version? please? just the function that format/prettify the json string/text? please?

thanks in advance

best regards

sunjw commented 5 months ago

There must be some code formatters in NuGet. If you really want to use the code from this plugin, you can wrap the C++ code with C#.

SalmaBegumJSR commented 5 months ago

There must be some code formatters in NuGet. If you really want to use the code from this plugin, you can wrap the C++ code with C#.

wow! you responded sir? i am so amazed! thanks a lot..

i am sorry to say.. but i don't want to use another nuget library/reference just to format my json text, so, yes i like to use your plugin code.

but again, as i have zero knowledge on c++, i really need your help to give me the code in c#? please? only the code to format the json string/text.

however, if you don't want or have enough time to write in c#, then you can just give me the function code in c++, i will try to convert them to c# using online resources..

thanks again

best regards

SalmaBegumJSR commented 5 months ago

@sunjw as per your suggestion, i have do some nuget search and find a project as follows: Json Formatter Plus

but this does not produce the formatted json as yours one does :(

this exactly produce same format what is currently i able to do, please check the following link: How To Format Json Text Properly

thanks in advance for your upcoming help/support

best regards

sunjw commented 5 months ago

I don't think you need much knowledge of C++ to implement your idea. It's just call some function like C#. You can refer to "sub-proj\JSFormatterTest\src\JSFormatterConsole.cpp", it is a very simple test code for formatter.

SalmaBegumJSR commented 5 months ago

@sunjw , dear sir, i even tried most of the solution from following link:

https://stackoverflow.com/questions/4580397/json-formatter-in-c

none of them are even close to yours :(

how did you find that logic? it's a GEM :)

best regards

SalmaBegumJSR commented 5 months ago

@sunjw if you don't mind do you know any one who knows both c++ and c#? who could help me to do the conversion? please?

best regards

sunjw commented 5 months ago

Couldn't answer your last question.