提交 1c63f0c1 编写于 作者: yunhaibao's avatar yunhaibao 🚀

Update ccc.md

上级 dc185290
```cls
/// Description: 以某固定分隔符拼接多个字符
ClassMethod ConnactString(split = ",", pArgs...)
```apex
/// Description: 字符串或流转json
/// Input: data - json格式的字符串或流
ClassMethod JSONParse(data) As %DynamicArray
{
s ret = ""
for i = 1 : 1 : pArgs {
s str = pArgs(i)
continue:(str = "")
s ret = $s(ret = "" : str , 1 : ret _ split _ str)
s stream = ##class(%GlobalCharacterStream).%New()
if $IsObject(data) {
d stream.CopyFrom(data)
}else{
d stream.Write(data)
}
q ret
if (stream.Read(1) = "[") {
s tObj=##class(%DynamicArray).%New()
} else {
s tObj=##class(%DynamicObject).%New()
}
d stream.Rewind()
s jsonData = tObj.%FromJSON(stream)
q jsonData
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册