is_json {TheOpenAIR}R Documentation

Check if the provided string is in valid JSON format.

Description

Check if the provided string is in valid JSON format.

Usage

is_json(input_string)

Arguments

input_string

A character string to be checked for JSON format.

Value

A logical value. If the input string is in valid JSON format, returns TRUE, otherwise returns FALSE.

Author(s)

Ulrich Matter umatter@protonmail.com

Examples

is_json('{"name": "John", "age": 30}')
# TRUE

is_json('{"name": "John", age: 30}')
# FALSE

is_json('')
# FALSE

[Package TheOpenAIR version 0.1.0 Index]