有没有人知道获取项目名称的前3个字符的语法?文档尚不清楚。它讨论了对字符串切片的支持。例如,@@ {foo [3:6]} @@,但它似乎没有工作。
最好的答案josenutanix.
Hi BCar,<\/p>
查看原版
Thanks for pointing this out. A ticket has been filed to fix this. In the interim you could use the following workaround:<\/p>
- Create a pre-create task type Set Variable - EScript<\/li>\t
- As code\t
project_name='@@{calm_project_name}@@'
print('PROJECT_NAME={}'.format(project_name[3:6])) # slice here<\/code><\/pre>\t\u00a0<\/p>\t<\/li>\t
- Output PROJECT_NAME<\/li>\t
- Use @@{PROJECT_NAME}@@ instead of @@{calm_project_name}@@ for naming convention<\/li><\/ol>","className":"post__content__best_answer"}">