Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!
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

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