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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Difference between DataLength and Length functions

rahulg1930481
Level 4
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
DavidKangni
Correct answer by
Community Advisor
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

View solution in original post

1 Reply
DavidKangni
Correct answer by
Community Advisor
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

View solution in original post