Invisible character treated as word?

Thierry Douez th.douez at gmail.com
Sat Jan 31 00:01:09 EST 2015


> function scrubbedText txt
>   repeat for each char k in txt
>     if charToNum(k) > 31 or charToNum(k) < 127 then put k after hold
>     else put space after hold
>   end repea
>   set itemDelimiter to tab
>   repeat for each line k in hold
>     repeat for each item i in k
>       put word 1 to -1 of i & tab after k2
>     end repeat
>     put return into char -1 of k2
>     put k2 after hold
>     put empty into k2
>   end repeat
>   return hold2
> end scrubbedText
>
> If anyone sees a way to do this without stepping through each character,
or without excluding non-standard visible characters, suggestions are welcome.

Hi David,

Umm, as invisible char has no-standard meaning,
I'm not completely sure if this one will fit your needs:

put replacetext( txt, "[^[:print:]\n\t]", empty) into newTxt

HTH,

Thierry

PS: if looking at regular expressions it's like a goat staring at a new fence,
please, accept my apologies and try to enjoy your week-end.


------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYperl - sunnYmidi - sunnYmage




More information about the use-livecode mailing list