On This Page

Home / Search/ Language Reference/ Functions/ Scalar Functions/ Conversion Functions/tostring

tostring ​

The tostring function converts the input to a value of type string.

Syntax ​

tostring( Expression )

Arguments ​

  • Expression: Expression to convert to a string.

Returns ​

If the Expression value is non-null, returns a string representation of Expression.

If the Expression value is null, returns null as well.

This is different from standard Kusto Query Language (KQL), in which tostring returns an empty string for null values.

Example ​

  • tostring(123) returns "123"
  • tostring("hello") returns "hello"
  • tostring(null) returns null
  • tostring(dynamic({"a":1,"b":2})) returns '{"a":1,"b":2}'
  • tostring(dynamic([1,2,3])) returns '[1,2,3]'