Solved

splitting up a variable.

Posted on 2000-03-27
3
148 Views
Last Modified: 2013-12-25
I've got a variable that looks like this:
$variable="this file can,be deleted,is this ok";
Now I want this variable to be splitted up , in three other variables namely $var1 and $var2 and $var3, at the point where the , resides. The outcome must look like this:
$var1="this file can";
$var2="be deleted";
$var3="is this ok";
(note: I don't want the , to be either in $var1 or $var2 or $var3)

Can someone help me out ?
0
Comment
Question by:oostwijk
  • 2
3 Comments
 

Expert Comment

by:akf
ID: 2663008
If this is in Perl (which it looks like), it's easy:

($var1, $var2, $var3) = split(',' , $variable);

0
 

Accepted Solution

by:
akf earned 31 total points
ID: 2663036
If this is in Perl (which it looks like), it's easy:

($var1, $var2, $var3) = split(',' , $variable);

0
 

Author Comment

by:oostwijk
ID: 2665710
Ok, that does the job :))
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now