Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

c# beautify json string

public class Product
{
    public string Name {get; set;}
    public DateTime Expiry {get; set;}
    public string[] Sizes {get; set;}
}

public void Main()
{
    Product product = new Product();
    product.Name = "Apple";
    product.Expiry = new DateTime(2008, 12, 28);
    product.Sizes = new string[] { "Small" };

    string json = JsonConvert.SerializeObject(product, Formatting.None);
    Console.WriteLine(json);
    json = JsonConvert.SerializeObject(product, Formatting.Indented);
    Console.WriteLine(json);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: backbone js cdn 
Javascript :: how to add a white space in jsx 
Javascript :: random color 
Javascript :: show the time zone of browser javascript 
Javascript :: js initialize array with values 
Javascript :: make object readonly javascript 
Javascript :: for loop javascript 
Javascript :: export component react 
Javascript :: check if radio button is selected jquery 
Javascript :: how to copy text from input through button click js 
Javascript :: Missing script: "start" react 
Javascript :: route parameter in node 
Javascript :: javascript export to pdf 
Javascript :: handlebarsjs each first element 
Javascript :: how to console in node js 
Javascript :: Difference in months between two dates in Javascript 
Javascript :: split string to char js 
Javascript :: completablefuture async example 
Javascript :: get selected text input javascript 
Javascript :: change cwd node 
Javascript :: react native text align vertical center 
Javascript :: angualar image upload service 
Javascript :: javascript get magnitude of number 
Javascript :: vue select first option default 
Javascript :: javascript how to do else if 
Javascript :: javascript statement 
Javascript :: lodash find duplicate element index 
Javascript :: append textarea jquery with value 
Javascript :: async await in javascript 
Javascript :: format dates momentjs 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =