在string中存储一些值会产生错误。 [英] storing some value in string gives error.
本文介绍了在string中存储一些值会产生错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在下面的字符串中存储[{Id:110}] ..
ex:
string str =[{Id:110}];
它给出错误;预期。需要存储确切格式[{Id:110}]
任何方式都可以这样做.. ??
解决方案
尝试转义with \ as \
string str = [{\Id:110 \}];
I am trying to store [{"Id:110"}] in string like below..
ex:
string str ="[{"Id:110"}]";
it gives error ; expected. need to store exact format [{"Id:110"}]
any way to do this ..??
解决方案
Try with escaping " with \ as \"
string str ="[{\"Id:110\"}]";
这篇关于在string中存储一些值会产生错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文