---
title: "size"

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

# size


    返回字符串或数组的大小。   
字符串的大小指字符串包含的字符数。数组的大小指数组中的元素个数。

    



    
`variable | size()` 返回一个 integer。
    



    
## 必选参数

        
             `variable` `array`, `string`：需要获取大小的变量。
        
    





    
## 例子

        
            

            


            

            
<SlineExample path={''} objects={ 
    [""] 
}>
```sline
{{#var arr = "one,two,three" | split(",") /}}

{{ arr | size() }}
```
</SlineExample>
            
        
    
