Expand my Community achievements bar.

SOLVED

Difference between DataLength and Length functions

Avatar

Level 4

I was looking into the List of functions available in ACS. I saw two functions DataLength and Length.

NameDescriptionSyntax
DataLengthReturns the number of characters in a stringDataLength(<String>)
LengthReturns the string lengthLength(<string>)

What is the difference between these two functions. Is the difference related to Unicode character length ?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @rahulg1930481 

DataLength function returns the number of bytes occupy in a variable. It also considered the spaces also.
Length function returns the number of characters in a variable. It also removes the trailing spaces and then return the length.

 

Thanks,

David



David Kangni

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @rahulg1930481 

DataLength function returns the number of bytes occupy in a variable. It also considered the spaces also.
Length function returns the number of characters in a variable. It also removes the trailing spaces and then return the length.

 

Thanks,

David



David Kangni