10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
其实识别一个Json是否为合法的很简单的,利用栈的思想就可以了,例如:{“temp”:["id":“012”,“value”:"123"]}这个Json首先将第一个{入栈,然后判断下一个字符和栈顶是否相等,如果不相等且是[、]、{、}、这类符号,那么久继续入栈,然后接着判断是否和栈顶相等,如果相等,且是前面说的那些字符,就进行出栈操作,最后字符串判断完,就检查栈是否为空,如果不为空则Json字符串不合法
The text was updated successfully, but these errors were encountered:
有可能,只是不懂栈是啥意思,有个图描述一下就好了。
Sorry, something went wrong.
No branches or pull requests
其实识别一个Json是否为合法的很简单的,利用栈的思想就可以了,例如:{“temp”:["id":“012”,“value”:"123"]}这个Json首先将第一个{入栈,然后判断下一个字符和栈顶是否相等,如果不相等且是[、]、{、}、这类符号,那么久继续入栈,然后接着判断是否和栈顶相等,如果相等,且是前面说的那些字符,就进行出栈操作,最后字符串判断完,就检查栈是否为空,如果不为空则Json字符串不合法
The text was updated successfully, but these errors were encountered: