Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Use File.basename To Return Just The Filename

DZone's Guide to

Use File.basename To Return Just The Filename

·
Free Resource

File.basename("/home/gumby/work/ruby.rb")          #=> "ruby.rb"

Resources:
 - Return the filename from a file path [dzone.com]
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}