Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

splitting up a variable.

Posted on 2000-03-27
3
Medium Priority
?
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 124 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

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

670 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