Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 9:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: To split a string to array variable
PostPosted: August 22nd, 2012, 12:20 am 
Offline

Joined: November 12th, 2004, 3:28 pm
Posts: 34
Location: Akureyri Iceland
Hello

I know this is supposed to be simple, but how do I split the string ABCD to an array variable TEST to get the following:

TEST[0] ="A"
TEST[1] ="B"

etc

Regards
Jónas

_________________
Jonas Helgason
Menntaskolinn á Akureyri
Iceland


For this message jonas has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: To split a string to array variable
PostPosted: August 22nd, 2012, 12:31 am 
Offline

Joined: November 12th, 2004, 3:28 pm
Posts: 34
Location: Akureyri Iceland
Hello again

I forgot - my string has separator A:B:C:D

Jónas

_________________
Jonas Helgason
Menntaskolinn á Akureyri
Iceland


For this message jonas has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: To split a string to array variable
PostPosted: August 22nd, 2012, 5:23 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Code:
myItems = "A:B:C:D";
TEST = myItems.split(":");
If you search the forum you will see examples of the split command.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group