longest word in a text

jbv jbv.silences at club-internet.fr
Fri Jul 14 14:46:36 EDT 2006

Hi list,

Does anyone have some very fast code to find the longest word
(number of chars) in a text ?

Here's what I have :

    replace " " with cr in myText
    put "" into temp
    set itemdelimiter to tab
    repeat for each line j in myText
        put j & tab & number of chars of j & cr after temp
    end repeat
    sort temp descending numeric by item 2 of each
    put item 1 of temp into longest_word

Is there anything faster ?


More information about the Use-livecode mailing list