标签:test join number art type cti function 分享 .net
function json2str(o) { var arr = []; var fmt = function(s) { if (typeof s == ‘object‘ && s != null) return json2str(s); return /^(string|number)$/.test(typeof s) ? ‘"‘ + s + ‘"‘ : s; } for (var i in o) arr.push("‘" + i + "‘:" + fmt(o[i])); return ‘{‘ + arr.join(‘,‘) + ‘}‘; } //json2str({a:1,sd:3}) //"{‘a‘:"1",‘sd‘:"3"}"
来自 : http://www.jb51.net/article/32825.htm
标签:test join number art type cti function 分享 .net
原文地址:http://www.cnblogs.com/zhujiasheng/p/6388951.html