# 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 ]; 
				
```

結果

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