Calm Macro Operations

  • 22 April 2021
  • 1 reply

Does any one know the syntax to get the first 3 characters of the project name ?  The documentation is not clear.  It talks about support for slicing for strings. For example, @@{foo[3:6]}@@, but it doesn’t seem to work.


Best answer by JoseNutanix 22 April 2021, 12:09

View original

This topic has been closed for comments

1 reply

Userlevel 4
Badge +5

Hi BCar,

Thanks for pointing this out. A ticket has been filed to fix this. In the interim you could use the following workaround:

  1. Create a pre-create task type Set Variable - EScript
  2. As code
    print('PROJECT_NAME={}'.format(project_name[3:6])) # slice here


  3. Output PROJECT_NAME
  4. Use @@{PROJECT_NAME}@@ instead of @@{calm_project_name}@@ for naming convention