Hi All,
Trying to figure out the best way to parse the date/time from my array.
Presently I am storing this value in my array "12/09/14 @ 06:58:05PM"
In Livecode what is the preferred method of parsing that string out to only give me this: "12/09/14"
Thanks!
Parsing string in an array
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Parsing string in an array
Hi.
Is that string a single element in the array? Or are they separate elements in a multi-dimensional array. I suspect the former.
In that case you will want to separate the two part of that string. Perhaps you can set the itemdelimiter to "@" and extract the first item. You may want to delete trailing spaces, if there are any.
Craig Newman
Is that string a single element in the array? Or are they separate elements in a multi-dimensional array. I suspect the former.
In that case you will want to separate the two part of that string. Perhaps you can set the itemdelimiter to "@" and extract the first item. You may want to delete trailing spaces, if there are any.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Parsing string in an array
The space character is used natively as a delimiter for words, so you could write:
We might need to modify that depending on how these are used in your array. Is the time stamp the key or the value?
Code: Select all
put word 1 of tTimeStamp into tDateOnlyVar
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Parsing string in an array
Thanks, Craig!
Much appreciated.
Much appreciated.
Re: Parsing string in an array
Hi.
Richard's suggestion is simpler.
More importantly, you need to become familiar with these sorts of tools. It requires a certain amount of effort to learn the basics of LC, and you simply must, because you will never be able to ask enough questions to make even a simple project work the way you want to. Dictionary, tutorials, user guide. These are fairly accessible and useful. Practice a lot.
Craig
Richard's suggestion is simpler.
More importantly, you need to become familiar with these sorts of tools. It requires a certain amount of effort to learn the basics of LC, and you simply must, because you will never be able to ask enough questions to make even a simple project work the way you want to. Dictionary, tutorials, user guide. These are fairly accessible and useful. Practice a lot.
Craig