Page 1 of 1

removing a character from a variable

Posted: Thu Mar 01, 2012 5:25 pm
by Mr LiveCode man
Hey guys,

Is it possible to remove a character from a variable? I Have a variable called _time . The data in it, is in the 2:45 format, and I need to remove the ':' so I can run some calculations and sorts on it and what not.

Any help would be much appreciated .


Lewis

Re: removing a character from a variable

Posted: Thu Mar 01, 2012 5:31 pm
by dunbarx
Check out the filter command in the dictionary.

I can think of several sillier ways to do it, like:
on mouseup
set the itemdel to ":"
put item 1 of yourData & item 2 of yourData into yourData
end mouseup

Craig Newman

Re: removing a character from a variable

Posted: Thu Mar 01, 2012 6:13 pm
by jacque
Two more ways:

Code: Select all

replace colon with empty in _time

delete char offset(colon,_time) of _time

Re: removing a character from a variable

Posted: Mon Mar 05, 2012 4:48 pm
by Mr LiveCode man
Thanks a lot folks!

Lewis