---
title: "gsql_length()"
component: "gsql-ref"
version: "3.11"
module: "ddl-and-loading"
html_url: "/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_length"
canonical_url: "https://www.tigergraph.com/docs/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_length"
markdown_url: "https://www.tigergraph.com/docs/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_length.md"
---

[View as HTML](https://www.tigergraph.com/docs/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_length)

# gsql_length()

Returns the length of a string.

## Syntax

`gsql_length(str)`

## Parameters

str

The string whose length to return.

## Return type

`INT`

## Example

gsql_length("abcd") -> 4
