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>
/**
* 一个增强版的文章段落格式化函数
* 使用)&nbsp;替换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),"&nbsp;&nbsp;&nbsp;","ALL");
//now return the text formatted in HTML
return replace(str,chr(10),"<br />","ALL");
}
</cfscript>

转载于:https://www.cnblogs.com/luren/archive/2006/12/28/605800.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值