CFLib.org – Common Function Library Project

trimAccessHyperlink(str)

Last updated June 25, 2008

author

Kurtis D. Leatham

Version: 0 | Requires: CF5 | Library: StrLib

Description:
MS Access stores hyperlink information like: www.KomputerMan.com#http://www.KomputerMan.com#. This tag removes the second part of that data leaving you with just www.KomputerMan.com.

Return Values:
Returns a string.

Example:

<cfsavecontent variable="myString">
 www.KomputerMan.com#http://www.KomputerMan.com#
</cfsavecontent>

<cfoutput>#trimAccessHyperlink(mystring)#</cfoutput>

Parameters:

Name Description Required
str String to parse. Yes

Full UDF Source:

/**
 * Convert an Access hyperlink field to text.
 * 
 * @param str 	 String to parse. (Required)
 * @return Returns a string. 
 * @author Kurtis D. Leatham (KDL@KomputerMan.com) 
 * @version 0, June 25, 2008 
 */
function trimAccessHyperlink(str) {
    var endTag = "";
    var extract = "";
    str = trim(str);    
    endTag = findNoCase("##", str);
    if (endTag gt 0) {
        endTag = endTag - 1;
        extract = left(str, endTag);
    } else {
        extract = str;
    }
    return trim(extract);
}
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