你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

strlen()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft 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