RosettaCodeData/Task/String-length/AppleScript/string-length-2.applescript

13 lines
255 B
AppleScript
Raw Normal View History

2013-04-11 01:07:29 -07:00
set inString to "Hello World" as Unicode text
set byteCount to 0
set idList to id of inString
repeat with incr in idList
set byteCount to byteCount + 2
if incr as integer > 65535 then
set byteCount to byteCount + 2
end if
end repeat
byteCount