Last but one
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Last but one
So, here I am trying to analyse a whopping-great text for words with certain
suffixes (= bits that go on the end of words) . . .
Now, it is dead easy to analyse texts for prefixes (= bits that go on the front of words)
using a series of nested loops for char 1, char, char 3 and so on . . .
Now I can ask questions about the last char of a word . . .
But, short of popping that word into a variable and nipping characters of the end
sequentially it seems "a bit of a pain" as I cannot do this sort of thing . . .
pseudoCode
last char
(last -1) char
(last -2) char
nicht?
suffixes (= bits that go on the end of words) . . .
Now, it is dead easy to analyse texts for prefixes (= bits that go on the front of words)
using a series of nested loops for char 1, char, char 3 and so on . . .
Now I can ask questions about the last char of a word . . .
But, short of popping that word into a variable and nipping characters of the end
sequentially it seems "a bit of a pain" as I cannot do this sort of thing . . .
pseudoCode
last char
(last -1) char
(last -2) char
nicht?
Re: Last but one
Maybe you mean:
char -1 of xxx ## = last char
char -2 of xxx ## = last but one char
char -3 of xxx ## = you guess...
?
char -1 of xxx ## = last char
char -2 of xxx ## = last but one char
char -3 of xxx ## = you guess...
?
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Last but one
Or if you combined those and cut out the middle, (if your talking about *just* the last 3 characters) why not
char -3 to -1 of xxx ## = last 3 chars
= "ing"
char -3 to -1 of xxx ## = last 3 chars
Code: Select all
put "working" into tmpWord; put char -3 to -1 of tmpWord

-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am