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: Klaus, FourthWorld, heatherlaine, 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 »

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: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: removing a character from a variable

Post 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
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: removing a character from a variable

Post by jacque »

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 »

Thanks a lot folks!

Lewis
Post Reply