---
title: "strLength"
canonical: "https://help.vicon.com/space/Shogun112/31230303/strLength"
format: markdown
---
# Description

Returns the length of string, which is the number of ASCII characters (not to be confused with the character module in Shogun Post) contained within the string.

## Functional area

String

# Command syntax

## Syntax

|  |
| --- |
| `strLength "string"` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `string` | string | yes | String to get the length of. |

### Flags

None

## Return value

integer

Returns the number of characters in the string. 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Get the length of a string
 string $str = "This is some text";
int $length;
 
// Length of str
$length = `strLength $str`;
print $length; 
// Should be 17
 
// Length of an empty string
$length = `strLength ""`;
print $length; 
// Should be 0
```

# Additional information

## Related commands

- [strCompare](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31228083)
- [strFind](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31236064)
- [strLeft](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31232699)
- [strMid](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31229178)
- [strReplace](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31234764)
- [strReverseFind](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31228001)
- [strRight](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31227930)
- [strTok](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31230232)
- [strTokArray](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31238788)