github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/len.en.md (about)

     1  ### `len()` {#fn-len}
     2  
     3  Function prototype: `fn len(val: str|map|list) int`
     4  
     5  Function description: Calculate the number of bytes in string, the number of elements in map and list.
     6  
     7  Function parameters:
     8  
     9  - `val`: Can be map, list or string
    10  
    11  Example:
    12  
    13  ```python
    14  # example 1
    15  add_key(abc, len("abc"))
    16  # result
    17  {
    18   "abc": 3,
    19  }
    20  
    21  # example 2
    22  add_key(abc, len(["abc"]))
    23  # result
    24  {
    25    "abc": 1,
    26  }
    27  ```