Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
File.join
(*::path) -> ::String
File.join(*components) → string
file.c
View on GitHub ↗
static VALUE
rb_file_s_join(int argc, VALUE *argv, VALUE klass)
{
return rb_file_join(argc, argv);
}
Returns a new string formed by joining the given string components with character '/':
Example
File.join # => "" File.join('foo') # => "foo" File.join(*%w[bar baz bat]) # => "bar/baz/bat"