How to find the offset of the first character in a string that's not a tab?

Dick Kriesel dick.kriesel at
Thu Jan 21 05:25:33 EST 2021

> On Jan 21, 2021, at 1:30 AM, Keith Clarke via use-livecode <use-livecode at <mailto:use-livecode at>> wrote:
> Please can anyone advise on the correct syntax for trying to find the first non-tab character offset in a string

Hi, Keith.  You could test each character until you find a tab:

function offsetOfNotTab pString
 local i
 repeat for each char tChar in pString
    add 1 to i
    if tChar <> tab then return i
 end repeat
end offsetOfNotTab

— Dick

More information about the use-livecode mailing list