Connect the world's APIs to Web3 with Chainlink Functions. Get started

Length Task

Returns the length of a byte array or string.


  • input: Byte array, or string to get the length for.


The length of the byte array or string.

Note: For strings containing multi-byte unicode characters, the output is the length in bytes and not number of characters.


my_length_task [type="length" input="xyz"]

Given the input string “xyz”, the task will return 3, length of the string.

Stay updated on the latest Chainlink news