Skip to content

Splitting Strings #13592

Closed Answered by jswxstw
jrussell9000 asked this question in Q&A
Sep 12, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Here is an example with expr:

metadata:
  name: test-split
  namespace: argo
spec:
  arguments:
    parameters:
      - name: message
        value: foo_bar
  entrypoint: argosay
  templates:
    - name: argosay
      inputs:
        parameters:
          - name: first
            value: '{{=split(workflow.parameters.message, "_")[0]}}'
          - name: second
            value: '{{=split(workflow.parameters.message, "_")[1]}}'
      container:
        name: main
        image: argoproj/argosay:v2
        command:
          - /argosay
        args:
          - echo
          - '{{inputs.parameters.first}} {{inputs.parameters.second}}'

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jrussell9000
Comment options

Answer selected by jrussell9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area/templating Templating with `{{...}}` type/support User support issue - likely not a bug
2 participants