0

Is it possible to trim a number to only keep the last 3 numbers ?

For exemple a phone number save in the variable, and I would like to keep the last 3 digit.

Kind regards

2

Here's one way. We set a variable called "the_phone_number" to some value, then pick off the last three characters. You can probably tell by inspection that it would be easy to modify this script to get the last four, or last two, or whatever.

set the_phone_number to "424-354-3548"
set the_last_three to characters -3 thru -1 of the_phone_number as string

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .