Re: Array to strings?
From: pingu (pingu_at_work.bcol.be)
Date: 03/23/05
- Previous message: gfs X: "Array to strings?"
- In reply to: gfs X: "Array to strings?"
- Next in thread: gfs X: "Re: Array to strings?"
- Reply: gfs X: "Re: Array to strings?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Mar 2005 11:44:28 +0100
gfs X wrote:
> Hi, Im a complete noob to perl.
> Is there a way to convert array values into a string?
>
> For example
>
> @myarr=("Sample","test","Array");
> My desired output: "SampletestArray"
> To then work with as a string.
>
> I know I could just specify piece by piece but thats just too much and
> very impractical (im using it to generate filenames)
>
> Much thanks in advance
>
see
perldoc perlfunc
look for 'join'
$string = join('',@myarr)
FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future
for general Perl questions.
- Previous message: gfs X: "Array to strings?"
- In reply to: gfs X: "Array to strings?"
- Next in thread: gfs X: "Re: Array to strings?"
- Reply: gfs X: "Re: Array to strings?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|