Easy way to get the "white space" before the first word of a line?
m.schonewille at economy-x-talk.com
Tue Mar 25 17:14:30 EDT 2008
Assuming that the whitespace always starts on char 1 of the line, this
function whiteSpace theText
return char 1 to (offset(word 1 of theText,theText) - 1) of theText
function whiteChunk theText
return "char 1 to" && (offset(word 1 of theText,theText) - 1)
Economy-x-Talk Consulting and Software Engineering
A large collection of scripts for HyperCard, Revolution, SuperCard and
other programming languages can be found at http://runrev.info
On 25 mrt 2008, at 22:08, David Bovill wrote:
> I want to get hold of the "white space" - ie tabs or space - before
> first word of a line. I can do it of course with repeat loops - but
> is there
> a way using Revs built in chunks?
> Something like:
> put word 0 to 1 of " first second"
More information about the Use-livecode