# Remove file extension

**URL:** <https://forum.kirupa.com/t/remove-file-extension/155078>\
**Category:** flash\
**Created:** [July 14, 2005, 4:25pm UTC](https://forum.kirupa.com/t/remove-file-extension/155078 "2005-07-14T16:25:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhamej](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rhamej](https://forum.kirupa.com/u/rhamej)\
**Post date:** [July 14, 2005, 4:25pm UTC](https://forum.kirupa.com/t/remove-file-extension/155078/1 "2005-07-14T16:25:57Z")

</div>

My varible “clip” equals a path to a image.  
If you trace “clip” you get this.

includes/gallery/imageName.jpg

I have figured out how to remove includes/gallery/ with this

clip = clip.substr(clip.lastIndexOf("/")+1);

But I also need to remove the .jpg extension so all I am left wiith is “imageName”.

Any ideas?
