---
title: "split"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/sline/filter/split'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/sline/filter/split.md'
---

# split


    使用指定的分隔符对字符串进行分割，返回一个字符串数组。

    



    
`str | split(separator)` 返回一个 string 数组。
    



    
## 必选参数

        
            - `str` `string`：原始字符串。
        
            - `separator` `string`：分割符。
        
    





    
## 例子

        
            

            


            

            
<SlineExample path={''} objects={ 
    [""] 
}>
```sline
{{#var words = "Festive Cheer Gift Box" | split(" ") /}}

{{#for word in words}}
    word: {{ word }}
{{/for}}

```
</SlineExample>
            
        
    
