truncate from the end of list/string
Posted: Fri Nov 25, 2005 8:41 am
Can't find a simple way for truncating from the end of the list.
In general:
(set 's "abcdefg")
(2 s) => "cdefg"
(-2 s) => "fg"
But, if I want to truncate a number of symbols from the end:
(truncate-2-symbols s) => "abcde"
then I must count the string's length before.
The same situation is for the list's contents...
Is there a simple solution?
In general:
(set 's "abcdefg")
(2 s) => "cdefg"
(-2 s) => "fg"
But, if I want to truncate a number of symbols from the end:
(truncate-2-symbols s) => "abcde"
then I must count the string's length before.
The same situation is for the list's contents...
Is there a simple solution?