Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
Switch services using the Version drop-down list. Learn more about navigation.
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Returns the length, in characters, of the input string.
Note
This function counts Unicode code points.
Syntax
strlen(source)
Learn more about syntax conventions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| source | string |
✔️ | The string for which to return the length. |
Returns
Returns the length, in characters, of the input string.
Examples
String of letters
print length = strlen("hello")
Output
| length |
|---|
| 5 |
String of letters and symbols
print length = strlen("⒦⒰⒮⒯⒪")
Output
| length |
|---|
| 5 |
String with grapheme
print strlen('Çedilla') // the first character is a grapheme cluster
// that requires 2 code points to represent
Output
| length |
|---|
| 8 |