routine join

Documentation for routine join, assembled from the following types:

class List

From List

(List) routine join

Defined as:

sub    join($separator*@list --> Str:D)
method join(List:D: $separator --> Str:D)

Treats the elements of the list as strings, interleaves them with $separator and concatenates everything into a single string.

Example:

join '', <a b c>;             # RESULT: «a, b, c» 

Note that the method form does not flatten sublists:

say (1, <a b c>).join('|');     # OUTPUT: «1|a b c␤» 

class IO::Spec::Unix

From IO::Spec::Unix

(IO::Spec::Unix) method join

Defined as:

method join ($Str:D $dirStr:D $file --> Str:D)

Similar to catpath, takes two path fragments and concatenates them, adding or removing a path separator, if necessary, except it will return just $file if both $dir and $file are string '/' or if $dir is the string '.'. The first argument is ignored (it exists to maintain consistent interface with other IO::Spec types for systems that have volumes).

IO::Spec::Unix.join($'foo''bar').say# OUTPUT: «foo/bar␤» 
IO::Spec::Unix.join($'/''/').say;     # OUTPUT: «/␤» 
IO::Spec::Unix.join($'.''foo').say;   # OUTPUT: «foo␤» 

class IO::Spec::Cygwin

From IO::Spec::Cygwin

(IO::Spec::Cygwin) method join

Defined as:

method join(|c)

Same as IO::Spec::Win32.join, except replaces backslashes with slashes in the final result.

class IO::Spec::Win32

From IO::Spec::Win32

(IO::Spec::Win32) method join

Defined as:

method join (Str:D $volumeStr:D $dirStr:D $file --> Str:D)

Similar to catpath, takes two path fragments and concatenates them, adding or removing a path separator, if necessary, except it will return just $file if both $dir and $file are string '/' or if $dir is the string '.'. The first argument is ignored (it exists to maintain consistent interface with other IO::Spec types for systems that have volumes).

IO::Spec::Win32.join('C:''/some/dir''foo.txt').say;
# OUTPUT: «C:/some/dir\and/more␤» 
 
IO::Spec::Win32.join('C:''.''foo.txt').say;
# OUTPUT: «C:foo.txt␤» 
 
IO::Spec::Win32.join('C:'\'/').say;
# OUTPUT: «C:\␤» 
 
IO::Spec::Win32.join('//server/share'\'/').say;
# OUTPUT: «//server/share␤» 
 
IO::Spec::Win32.join('E:''''foo.txt').say;
# OUTPUT: «E:foo.txt␤» 

class Thread

From Thread

(Thread) method join

method join(Thread:D)

Waits for the thread to finish.