chr(10) chr(13) chr(32)
chr(13) 是一个回车;Chr(10) 是个换行符;chr(32) 是一个空格符;chr(13) 是一个回车;9\34 是tab,未确定?
(例子:把所有回车符替换为<br/>
#Replace(foo, Chr(13), "<br />", "ALL")#
)
所有关于 ASCII码的表格:http://www.asciitable.com
<cfscript>
/**
* 一个增强版的文章段落格式化函数
* 使用) 替换TAB,支持多系统
* Rewrite and multiOS support by Nathan Dintenfas.
*
* @param string The string to format. (Required)
* @return Returns a string.
* @author Ben Forta (ben@forta.com)
* @version 3, June 26, 2002
*/
function Paragrap1hFormat2(str) {
//first make Windows style into Unix style
str = replace(str,chr(13)&chr(10),chr(10),"ALL");
//now make Macintosh style into Unix style
str = replace(str,chr(13),chr(10),"ALL");
//now fix tabs
str = replace(str,chr(9)," ","ALL");
//now return the text formatted in HTML
return replace(str,chr(10),"<br />","ALL");
}
</cfscript>
(例子:把所有回车符替换为<br/>
#Replace(foo, Chr(13), "<br />", "ALL")#
)
所有关于 ASCII码的表格:http://www.asciitable.com
<cfscript>
/**
* 一个增强版的文章段落格式化函数
* 使用) 替换TAB,支持多系统
* Rewrite and multiOS support by Nathan Dintenfas.
*
* @param string The string to format. (Required)
* @return Returns a string.
* @author Ben Forta (ben@forta.com)
* @version 3, June 26, 2002
*/
function Paragrap1hFormat2(str) {
//first make Windows style into Unix style
str = replace(str,chr(13)&chr(10),chr(10),"ALL");
//now make Macintosh style into Unix style
str = replace(str,chr(13),chr(10),"ALL");
//now fix tabs
str = replace(str,chr(9)," ","ALL");
//now return the text formatted in HTML
return replace(str,chr(10),"<br />","ALL");
}
</cfscript>