dolphindb中如何实现类似python中的join方法

如下,在python中有一行代码,将序列中的元素以指定的字符连接生成一个新的字符串:

>>> ','.join(["{}D".format(i) for i in range(1,6)])
'1D,2D,3D,4D,5D'

请问在dolphin db里怎么实现呢?


请先 登录 后评论

2 个回答

mhxiang

在dolphindb中可以通过concat函数实现,动态生成字符数组可以通过each实现

concat(each(x->string(x)+`D,1..5),',')
1D,2D,3D,4D,5D
请先 登录 后评论
Xiaohua Zhou
concat(string(1..5) + "D", ',')
请先 登录 后评论