CFLib.org – Common Function Library Project

stripOuterQuotes(string)

Last updated December 13, 2010

author

Pete Ruckelshaus

Version: 0 | Requires: CF5 | Library: StrLib

Description:
Strips doublequotes from the beginning and end of a string. Useful for cleaning up CSV data that uses quoted columns.

Return Values:
Returns a string.

Example:

<cfset sample = """ray""">
<cfoutput>#stripOuterQuotes(sample)#</cfoutput>

Parameters:

Name Description Required
string String to modify. Yes

Full UDF Source:

/**
 * Strips doublequotes from the beginning and end of a string.
 * 
 * @param string 	 String to modify. (Required)
 * @return Returns a string. 
 * @author Pete Ruckelshaus (pruckelshaus@gmail.com) 
 * @version 0, December 13, 2010 
 */
function stripOuterQuotes(string) {
	if (left(string, 1) EQ """") {
		string = right(string, len(string) -1);
	}
	if (right(string, 1) EQ """") {
		string = left(string, len(string) -1);
	}
	return string;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson