有人知道获得项目名称的前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"}">