循环遍历列表并连接字符串嗨,我有一个“列表”,我想将每个后缀“ _2020”连接起来,然后将其插入新列表。
我已经尝试过此代码,但是缺少一些东西。感谢您的投入。
谢谢!
Names Default To Here( 1 );
FullNames ={};
todaysList = {"August", "July", "June", "May"};
TotalMs = N Items (todaysList);
For (i = todaysList, i <= TotalMs, i++,
newName = (todaysList[i] ||"_2020");
Insert Into (FullNames, newName),
);
脚本编写回复:循环遍历列表并连接字符串您的For()循环起始索引无效。这是您的代码,稍作修改以使其起作用
Names Default To Here( 1 );
FullNames ={};
todaysList = {"August", "July", "June", "May"};
TotalMs = N Items (todaysList);
For (i = 1, i <= TotalMs, i++,
newName = todaysList[i] ||"_2020";
Insert Into (FullNames, newName),
);回复:循环遍历列表并连接字符串是的,我可以看到我的索引错误,非常明显(在您提到之后)。我仍然不明白的是,连接表达式周围没有括号。我会做更多的阅读。
非常感谢你。
最好的祝福,
阿尔弗雷多
回复:循环遍历列表并连接字符串你好
在JMP脚本索引(帮助->脚本索引)中搜索Concat函数,可以看到使用双杠运算符不需要括号。如果您不知道它,脚本索引是一个非常强大的资源。
