faster right trim

new topic     » topic index » view thread      » older message » newer message

This one is simpler & faster than previous one:

function rtrim(sequence s)
    -- discard trailing whitespace of sequence s

    for i = length(s) to 1 by -1 do
        if not find(s[i], {9,10,13,32}) then  return s[1..i] end if
    end for
    return {}
end function

jiri

----- Original Message -----
From: "Brian" <impee3 at EXCITE.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, December 14, 2000 5:32 PM
Subject: Whitespaces


> What's the easiest way to get rid of whitespaces at the end of a
string of
> text?
>
> Thanks,
> Brian
>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu