用逗号分隔的元素重新创建字符串

re-creating string with elements separated by commas

我正在使用如下所示的本地宏:

loc str_orig "2000 2015 2019 2020"

我想在不使用循环的情况下实现以下目标:

"2000, 2015, 2019, 2020"

是否有内置(最好是一行)命令来实现这一点?

您可以将 space 替换为逗号和 space。

local str_orig "2000 2015 2019 2020"

local str_comma : subinstr local str_orig " " ", ", all

有关扩展宏功能的信息,另请参阅 help extended_fcn