Answers for "check if a string can be con verted to json in js"

PHP
8

if json valide js

function IsJsonString(str) {
    try {
        JSON.parse(str);
    } catch (e) {
        return false;
    }
    return true;
}
Posted by: Guest on April-10-2020

Code answers related to "check if a string can be con verted to json in js"

Browse Popular Code Answers by Language