title | description | ms.reviewer | ms.topic | ms.date |
---|---|---|---|---|
strlen() |
Learn how to use the strlen() function to measure the length of the input string. |
alexans |
reference |
02/05/2023 |
Returns the length, in characters, of the input string.
Note
This function counts Unicode code points.
strlen(
source)
[!INCLUDE syntax-conventions-note]
Name | Type | Required | Description |
---|---|---|---|
source | string |
✔️ | The string for which to return the length. |
Returns the length, in characters, of the input string.
[!div class="nextstepaction"] Run the query
print length = strlen("hello")
Output
length |
---|
5 |
[!div class="nextstepaction"] Run the query
print length = strlen("⒦⒰⒮⒯⒪")
Output
length |
---|
5 |
[!div class="nextstepaction"] Run the query
print strlen('Çedilla') // the first character is a grapheme cluster
// that requires 2 code points to represent
Output
length |
---|
8 |