CFLib.org – Common Function Library Project

VerticalText(text)

Last updated August 14, 2002

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

 
Rated 1 time(s). Average Rating: 4.0

Description:
Puts line breaks into text to make it appear vertically.

Return Values:
Returns a string.

Example:

view plain print about
<cfoutput>#VerticalText("Hello World")#</cfoutput>

Parameters:

Name Description Required
text Text to modify. Yes

Full UDF Source:

view plain print about
<cfscript>
/**
 * Take a string, make it appear vertically.
 * 
 * @param text      Text to modify. (Required)
 * @return Returns a string. 
 * @author Nathan Dintenfass (nathan@changemedia.com) 
 * @version 1, August 14, 2002 
 */

function VerticalText(text){
    //build an array of the characters in the string
    var arrText = arrayNew(1);
    //a variable for looping
    var ii = 1;
    //the len of the string
    var textLen = len(text);
    //resize the array the length of the string
    arrayResize(arrText,textLen);
    //loop through the length of the string, building the array
    for(ii = 1; ii LTE textLen; ii = ii + 1){
        arrText[ii] = mid(text,ii,1);
    }
    return arrayToList(arrText,"<br />");
}
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Dave Anderson Dave Anderson added
iniToStruct
20 day(s) ago

Dave Anderson Dave Anderson added
deDupeArray
20 day(s) ago

Richard Richard added
dice
22 day(s) ago

Isaac Dealey Isaac Dealey added
getRelative
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 22 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Raymond Camden highlightAndCrop
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson