Description
Gets the string value of the key.
If more than one key with the same name exists, then get the value of the first key. Notice that the IgnoreCase property (true by default) determines whether the key name will be matched in a case-sensitive manner.
Applies to
JSONPackage object
Syntax
objectname.GetValueString ( Key )
Argument |
Description |
---|---|
objectname |
The name of the JSONPackage object |
Key |
A string specifying the key of the item of JsonStringItem type. If more than one key with the same name already exists, the value of the first key will be obtained. |
Return value
String. Returns the key value if it succeeds. If any argument's value is null, the method returns null. If an error occurs, throw the exception.
Examples
This example obtains the string value ("R & D8") of the dept_name key from the JSON string.
// String GetValueString ( string Key ) String ls_DeptName JsonPackage ljp_Dept ljp_Dept = Create JsonPackage // Loads the JSON string to the JSONPackage object. ljp_Dept.loadstring( '{"dept_id":100,"dept_name":"R & D8","dept_head_id":105}') // Gets the key value: ls_DeptName = R & D8 ls_DeptName = ljp_Dept.GetValueString ( "dept_name" )
See also