# Len - 脚本和图表函数

Len() 用于返回输入字符串的长度。

语法：

Len(text)

返回数据类型： 整数

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/Len.htm)

#### 示例 - 图表表达式

| 示例 | 结果 |
| --- | --- |
| `Len('Peter')` | 返回“5” |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/Len.htm)

#### 示例：加载脚本

```
T1:
Load String, First&Second as NewString;
Load *, mid(String,len(First)+1) as Second;
Load *, upper(left(String,1)) as First;
Load  * inline [
String
this is a sample text string
capitalize first letter only ]; 
				
```

结果

| 字符串 | 新字符串 |
| --- | --- |
| this is a sample text string | This is a sample text string |
| capitalize first letter only | Capitalize first letter only |