34.204.169.76 |    

Navigation

Google Advertisement

Die Funktion array_space() wandelt ein Array in einem String um und füllt den Raum zwischen den Array Elementen mit ein definierten Zeichen.

array_space
  1. # **************************************
  2. # fill out space between array entrys...
  3.  
  4. @num = (1..5);
  5. print array_space( '|', @num ); # 1|2|3|4|5
  6.  
  7. sub array_space {
  8.  
  9. my ($sep, @temp)=@_;
  10. my $str;
  11.  
  12. if ( $#temp>0 ) {
  13.         foreach my $tmp( @temp ) {
  14.                 $str.=$tmp;
  15.                 $str.=$sep unless ( $tmp eq $temp[$#temp] );
  16.         }
  17. }
  18. return $str;
  19.  
  20. }
  21.  
Parsed in 0.003 seconds at 115.58 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)
STDERR
(Bash::Function)
radius
(CSS)
shadow
(CSS)
rotate
(CSS)
create_function
(JavaScript::Snippets)