RosettaCodeData/Task/Empty-string/AppleScript/empty-string.applescript

31 lines
461 B
AppleScript
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
-- assign empty string to str
set str to ""
-- check if string is empty
if str is "" then
2026-02-01 16:33:20 -08:00
-- str is empty
2023-07-01 11:58:00 -04:00
end if
-- or
if id of str is {} then
2026-02-01 16:33:20 -08:00
-- str is empty
2023-07-01 11:58:00 -04:00
end if
-- or
if (count of str) is 0 then
2026-02-01 16:33:20 -08:00
-- str is empty
2023-07-01 11:58:00 -04:00
end if
-- check if string is not empty
if str is not "" then
2026-02-01 16:33:20 -08:00
-- string is not empty
2023-07-01 11:58:00 -04:00
end if
-- or
if id of str is not {} then
2026-02-01 16:33:20 -08:00
-- str is not empty
2023-07-01 11:58:00 -04:00
end if
-- or
if (count of str) is not 0 then
2026-02-01 16:33:20 -08:00
-- str is not empty
2023-07-01 11:58:00 -04:00
end if