Solved

splitting up a variable.

Posted on 2000-03-27
3
147 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
Comment Utility
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
Comment Utility
If this is in Perl (which it looks like), it's easy:

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

0
 

Author Comment

by:oostwijk
Comment Utility
Ok, that does the job :))
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This article will show, step by step, how to integrate R code into a R Sweave document
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

763 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

7 Experts available now in Live!

Get 1:1 Help Now