split
Generally, the split function is used together with the select or get_list_length function. The split function is mainly used in the following scenarios:
- A string is split into a group of strings so that specific elements can be easily obtained from the result string list.
- A result string array is directly used.
Syntax
split: [delimiter, sourceString ]
Parameters
| Parameter | Description |
|---|---|
| delimiter | Separator, which can be a string, single character, or variable obtained using the get_input function. |
| sourceString | Original string, which can be a variable obtained using the get_input function. Original strings are grouped by separators. |
Return Values
Split string arrays are returned.
Examples
The following describes how to use the split function to group strings:
inputs:
source:
default: "a,b,c,d,e,f,g"
node_templates:
test:
type: HuaweiCloud.AOS.Stack
properties:
templateId: "abcdf-fdeee"
inputs:
aaa: {select: [0, {split: [",", {get_input: source}]}]} # The value is a. Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.