-
-
Save doekman/ee9e4651043c5b346f15a0ffbce21b94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on trim(theseCharacters, someText) | |
if class of someText is text and length of someText > 0 then | |
-- default values (all whitespace) | |
if theseCharacters is true then ¬ | |
set theseCharacters to {" ", tab, ASCII character 10, return, ASCII character 0} | |
repeat until first character of someText is not in theseCharacters | |
set someText to text 2 thru -1 of someText | |
end repeat | |
repeat until last character of someText is not in theseCharacters | |
set someText to text 1 thru -2 of someText | |
end repeat | |
end if | |
return someText | |
end trim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment