Was this page helpful?

Json.Format

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    Json.Format(value : str) : str

    Render the Json data.

    Usage Restrictions

    9.02 or later.

    Parameters

    Name Type Description
    value str value to convert

    Result

    A string containing the pretty printed version of the passed json data

    Samples

       Output

    Format some json:

    web.pre(
      json.format(
        { 'x' : { 'a' : 1, 'b' : 2}, 'y' : ['foo','bar'] }
      )
    )  
    { 
        "x": { 
            "a": 1, 
            "b": 2
        }, 
        "y": [ 
            "foo", 
            "bar"
        ]
    }

     

     

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by