---
title: GetLength
description: "获取字符串的长度。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00288.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00288.html
indexId: 67bf94bb29cea7f835b059503739b8cd927b1e53fd0a058e4b37a5c7e1ad97c878
---
# GetLength

#### 函数功能

获取字符串的长度。


#### 函数原型

```
size_t GetLength() const
```


#### 约束说明

无。


#### 参数说明

无。


#### 返回值

字符串的长度。
