parseJsonString

Modified on Wed, 02 Aug 2023

Description

Convert the JSON string value to an object

Syntax

parseJsonString(input)

Parameters

Input ParameterTypeDescription
inputstringJSON string

Return value

Type
any

Sample

ExampleResultDescription
parseJsonString('1.25')1.25Parse JSON string for number
parseJsonString('true')trueParse JSON string for boolean value
parseJsonString('null')nullParse JSON string for null value
parseJsonString('"abc"')"abc"Parse JSON string for string value
parseJsonString('[1, 2, 3]')[1, 2, 3]Parse JSON string for list of numbers
parseJsonString('["1", "2", "3"]')["1", "2", "3"]Parse JSON string for list of string values
parseJsonString('{"age":31,"name":"John"}'){"age":31,"name":"John"}Parse JSON string for a JSON object

To view all the String functions, click here.