CFLib.org – Common Function Library Project

ripExt(name)

Last updated July 18, 2006
Download UDF

author

Richard                                           Richard

Version: 1 | Requires: ColdFusion 5 | Library: FileSysLib

 
Rated 1 time(s). Average Rating: 5.0

Description:
This function (which is just a regular expression) strips off the extension from a filename. Dots within the filename are preserved.

Return Values:
Returns a string.

Example:

<cfset filename="this.is.your.file.jpeg">
<cfoutput>#ripExt(filename)#</cfoutput>

Parameters:

Name Description Required
name Filename. Yes

Full UDF Source:

<cfscript>
/**
* Function returns filename without extension.
*
* @param name      Filename. (Required)
* @return Returns a string.
* @author Richard (acdhirr@trilobiet.nl)
* @version 1, July 18, 2006
*/

function ripExt(name) {
    return reReplace(arguments.name,"\.[^.]*$","");
}
</cfscript>

Search CFLib.org


Latest Additions

Shawn Porter Shawn Porter added
DeMoronize
2 hour(s) ago

Chris Carey Chris Carey added
readPropertiesFi...
1 day(s) ago

Randy Johnson Randy Johnson added
lastDayofWeek
3 day(s) ago

Frank Marion Frank Marion added
sitemapPing
7 day(s) ago

Top Rated

James Sleeman                                     QuickSort
Rated 5.0, 3 time(s)

Barney Boisvert indentXml
Rated 5.0, 3 time(s)

Nathan Dintenfass                                 queryColumnsToSt...
Rated 5.0, 3 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 3 time(s)

Created by Raymond Camden / Design by Justin Johnson