removing a character from a variable

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mr LiveCode man
Posts: 4
Joined: Mon Dec 12, 2011 1:29 pm

removing a character from a variable

Post by Mr LiveCode man » Thu Mar 01, 2012 5:25 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: removing a character from a variable

Post by dunbarx » Thu Mar 01, 2012 5:31 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7392
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: removing a character from a variable

Post by jacque » Thu Mar 01, 2012 6:13 pm

Two more ways:

Code: Select all

replace colon with empty in _time

delete char offset(colon,_time) of _time
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mr LiveCode man
Posts: 4
Joined: Mon Dec 12, 2011 1:29 pm

Re: removing a character from a variable

Post by Mr LiveCode man » Mon Mar 05, 2012 4:48 pm

Thanks a lot folks!

Lewis

Post Reply