Replace( 字符串表达式,findnreplacewith[,start[,count[,compare]]])
将一个字符串取代 部份字。寻找待取代的原字符串 (find) ,
若找到则被取代为新字符串 (replacewith) 。
find :待寻找取代的原字符串。
replacewith :取代后的字。
start :从第几个字开始寻找取代, 若未设定则由第一个字开始寻找。
count :取代的次数。 若未设定则所有寻找到的字符串取代字符 串全部被取代。
compare :寻找比较的方法, compare=0 表示二进制比较法, compare=1 表文字比较法, compare =2 表根据比较的 数据型态而定,若省略 compare 则为预设的二进制比较法。
例子: Replace("ABCD123ABC","AB","ab")
结果: abCD123abC
" chr(34) "
' '
& &
< <
> >
chr(39) '
chr(32)
chr(9)
chr(13)
chr(10) <br>
chr(10) chr(10) </p><p>
chr码的资料
Chr("32") SPACE Chr("33") ! Chr("34") " Chr("35") # Chr("36") $ Chr("37") %
Chr("37") % Chr("38") & Chr("39") ’ Chr("40") ( Chr("41") ) Chr("42") *
Chr("42") * Chr("43") + Chr("44") , Chr("45") - Chr("46") . Chr("47") /
Chr("47") / Chr("48") 0 Chr("49") 1 Chr("50") 2 Chr("51") 3 Chr("52") 4
Chr("52") 4 Chr("53") 5 Chr("54") 6 Chr("55") 7 Chr("56") 8 Chr("57") 9
Chr("57") 9 Chr("58") : Chr("59") ; Chr("60") < Chr("61") = Chr("62") >
Chr("62") > Chr("63") ? Chr("64") @ Chr("65") A Chr("66") B Chr("67") C
Chr("67") C Chr("68") D Chr("69") E Chr("70") F Chr("71") G Chr("72") H
Chr("72") H Chr("73") I Chr("74") J Chr("75") K Chr("76") L Chr("77") M
Chr("77") M Chr("78") N Chr("79") O Chr("80") P Chr("81") Q Chr("82") R
Chr("82") R Chr("83") S Chr("84") T Chr("85") U Chr("86") V Chr("87") W
Chr("87") W Chr("88") X Chr("89") Y Chr("90") Z Chr("91") [ Chr("92") \
Chr("92") \ Chr("93") ] Chr("94") ^ Chr("95") _ Chr("96") ` Chr("97") a
Chr("97") a Chr("98") b Chr("99") c Chr("100") d Chr("101") e Chr("102") f
Chr("102") f Chr("103") g Chr("104") h Chr("105") i Chr("106") j Chr("107") k
Chr("107") k Chr("108") l Chr("109") m Chr("110") n Chr("111") o Chr("112") p
Chr("112") p Chr("113") q Chr("114") r Chr("115") s Chr("116") t Chr("117") u
Chr("117") u Chr("118") v Chr("119") w Chr("120") x Chr("121") y Chr("122") z
Chr("122") z Chr("123") { Chr("124") | Chr("125") } Chr("126") ~ Chr("127")
Chr("127") Chr("128") ? Chr("129") Chr("130") Chr("131") Chr("132")
< SCRIPT LANGUAGE ="JavaScript" >
<!--
function test(obj) {
obj.innerText = " ddd\naaa " ;
}
// -->
</ SCRIPT >
< TEXTAREA id ="tt" NAME ="" ROWS ="" COLS ="" onclick ="test(this);" ></ TEXTAREA >
不
是
换
行
么">there</a>
html中
<
,
>
,
&
有特殊含义,(前两个字符用于链接签,&用于转义),不能直接使用。使用这三个字符时,应使用它们的转义序列。
< 的转义序列为 & lt; & #60;
> 的转义序列为 & gt; & #62;
前者为字符转义序列,后者为数字转义序列。
例如 & lt; font &Lgt;显示为,若直接写为则被认为是一个链接签。
需要说明的是:
a. 转义序列各字符间不能有空格;
b. 转义序列必须以";"结束;
c. 单独的&不被认为是转义开始。
d.区分大小写
html使用的字符集是ISO &859 Larin-1字符集,该字符集中有许多标准键盘上无法输入的字符。对这些特殊字符只能使用转义序列。
转义序列 转义结果
\b Backspace字符(ASCII 8)
\f 走纸换页字符(ASCII 12)
\n 换行字符(ASCII 10)
\r 回车自负(ASCII 13)
\t 制表符(Tab)(ASCII 9)
\" 双引号
\' 单引号
\\ 反斜线符号(\)
\000~\377 一个用8进制指定的字符(占一个字节)
\x00~\xFF 一个用16进制指定的字符(占一个字节)
\u0000~\uFFFF 一个用16进制指定的Unicode字符(占两个字符)
----------------
<!--************************************************************************************************* commet for using FREETEXTBOX <p> <table class="large" cellspacing="0" cellpadding="5" width="100%" border="0"> <tbody> <tr valign="top"> <td> <table cellspacing="0" cellpadding="2" width="100%" border="1"> <tbody> <tr> <td bgcolor="navy"><span><font color="white">HTML 原始码</font></span></td> <td bgcolor="navy"><span><font color="white">显示结果</font></span></td> <td bgcolor="navy"><span><font color="white">描述</font></span></td></tr> <tr> <td><span>&amp;lt;</span></td> <td><span>&lt;</span></td> <td><span>小於号或显示标记</span></td></tr> <tr> <td><span>&amp;gt;</span></td> <td><span>&gt;</span></td> <td><span>大於号或显示标记</span></td></tr> <tr> <td><span>&amp;amp;</span></td> <td><span>&amp;</span></td> <td><span>可用於显示其它特殊字符</span></td></tr> <tr> <td><span>&amp;quot;</span></td> <td><span>"</span></td> <td><span>引号</span></td></tr> <tr> <td><span>&amp;reg;</span></td> <td><span>®</span></td> <td><span>己注册</span></td></tr> <tr> <td><span>&amp;copy;</span></td> <td><span>©</span></td> <td><span>版权</span></td></tr> <tr> <td><span>&amp;trade;</span></td> <td><span>™</span></td> <td><span>商标</span></td></tr> <tr> <td><span>&amp;ensp;</span></td> <td><span>&nbsp;</span></td> <td><span>半方大的空白</span></td></tr> <tr> <td><span>&amp;emsp;</span></td> <td><span>&nbsp;</span></td> <td><span>全方大的空白</span></td></tr> <tr> <td><span>&amp;nbsp;</span></td> <td><span>&nbsp;</span></td> <td><span>不断行的空白</span></td></tr></tbody></table></td></tr> <tr> <td bgcolor="#bbd1d1"> <div style="FONT-SIZE: 9pt;><font color="#ca00ca">■ ISO Latin-1 特殊字符 :</font></div></td></tr> <tr valign="top"> <td> <table cellspacing="0" cellpadding="2" width="100%" border="1"> <tbody> <tr> <td bgcolor="navy"><span><font color="white">HTML 原始码</font></span></td> <td bgcolor="navy"><span><font color="white">显示结果</font></span></td> <td bgcolor="navy"><span><font color="white">描述</font></span></td></tr> <tr> <td><span>&amp;AElig;</span></td> <td><span>Æ</span></td> <td><span>Uppercase AE diphthing</span></td></tr> <tr> <td><span>&amp;Aacute;</span></td> <td><span>Á</span></td> <td><span>Uppercase A, acute accent</span></td></tr> <tr> <td><span>&amp;Acirc;</span></td> <td><span>Â</span></td> <td><span>Uppercase A, circumflex accent</span></td></tr> <tr> <td><span>&amp;Agrave;</span></td> <td><span>À</span></td> <td><span>Uppercase A, grave accent</span></td></tr> <tr> <td><span>&amp;Aring;</span></td> <td><span>Å</span></td> <td><span>Uppercase A, ring</span></td></tr> <tr> <td><span>&amp;Atilde;</span></td> <td><span>Ã</span></td> <td><span>Uppercase A, tilde</span></td></tr> <tr> <td><span>&amp;Auml;</span></td> <td><span>Ä</span></td> <td><span>Uppercase A, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;Ccedil;</span></td> <td><span>Ç</span></td> <td><span>Uppercase C, cedilla</span></td></tr> <tr> <td><span>&amp;ETH;</span></td> <td><span>Ð</span></td> <td><span>Uppercase Eth, Icelandic</span></td></tr> <tr> <td><span>&amp;Eacute;</span></td> <td><span>É</span></td> <td><span>Uppercase E, acute accent</span></td></tr> <tr> <td><span>&amp;Ecirc;</span></td> <td><span>Ê</span></td> <td><span>Uppercase E, circumflex accent</span></td></tr> <tr> <td><span>&amp;Egrave;</span></td> <td><span>È</span></td> <td><span>Uppercase E, grave accent</span></td></tr> <tr> <td><span>&amp;Euml;</span></td> <td><span>Ë</span></td> <td><span>Uppercase E, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;Iacute;</span></td> <td><span>Í</span></td> <td><span>Uppercase I, acute accent</span></td></tr> <tr> <td><span>&amp;Icirc;</span></td> <td><span>Î</span></td> <td><span>Uppercase I, circumflex accent</span></td></tr> <tr> <td><span>&amp;Igrave;</span></td> <td><span>Ì</span></td> <td><span>Uppercase I, grave accent</span></td></tr> <tr> <td><span>&amp;Iuml;</span></td> <td><span>Ï</span></td> <td><span>Uppercase I, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;Ntilde;</span></td> <td><span>Ñ</span></td> <td><span>Uppercase N, tilde</span></td></tr> <tr> <td><span>&amp;Oacute;</span></td> <td><span>Ó</span></td> <td><span>Uppercase O, acute accent</span></td></tr> <tr> <td><span>&amp;Ocirc;</span></td> <td><span>Ô</span></td> <td><span>Uppercase O, circumflex accent</span></td></tr> <tr> <td><span>&amp;Ograve;</span></td> <td><span>Ò</span></td> <td><span>Uppercase O, grave accent</span></td></tr> <tr> <td><span>&amp;Oslash;</span></td> <td><span>Ø</span></td> <td><span>Uppercase O, slash</span></td></tr> <tr> <td><span>&amp;Otilde;</span></td> <td><span>Õ</span></td> <td><span>Uppercase O, tilde</span></td></tr> <tr> <td><span>&amp;Ouml;</span></td> <td><span>Ö</span></td> <td><span>Uppercase O, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;THORN;</span></td> <td><span>Þ</span></td> <td><span>Uppercase THORN, Icelandic</span></td></tr> <tr> <td><span>&amp;Uacute;</span></td> <td><span>Ú</span></td> <td><span>Uppercase U, acute accent</span></td></tr> <tr> <td><span>&amp;Ucirc;</span></td> <td><span>Û</span></td> <td><span>Uppercase U, circumflex accent</span></td></tr> <tr> <td><span>&amp;Ugrave;</span></td> <td><span>Ù</span></td> <td><span>Uppercase u, grave accent</span></td></tr> <tr> <td><span>&amp;Uuml;</span></td> <td><span>Ü</span></td> <td><span>Uppercase U, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;Yacute;</span></td> <td><span>Ý</span></td> <td><span>Uppercase Y, acute accent</span></td></tr> <tr> <td><span>&amp;aelig;</span></td> <td><span>æ</span></td> <td><span>Lowercase ae diphthing</span></td></tr> <tr> <td><span>&amp;aacute;</span></td> <td><span>á</span></td> <td><span>Lowercase a, acute accent</span></td></tr> <tr> <td><span>&amp;acirc;</span></td> <td><span>â</span></td> <td><span>Lowercase a, circumflex accent</span></td></tr> <tr> <td><span>&amp;agrave;</span></td> <td><span>à</span></td> <td><span>Lowercase a, grave accent</span></td></tr> <tr> <td><span>&amp;aring;</span></td> <td><span>å</span></td> <td><span>Lowercase a, ring</span></td></tr> <tr> <td><span>&amp;atilde;</span></td> <td><span>ã</span></td> <td><span>Lowercase a, tilde</span></td></tr> <tr> <td><span>&amp;auml;</span></td> <td><span>ä</span></td> <td><span>Lowercase a, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;ccedil;</span></td> <td><span>ç</span></td> <td><span>Lowercase c, cedilla</span></td></tr> <tr> <td><span>&amp;eth;</span></td> <td><span>ð</span></td> <td><span>Lowercase eth, Icelandic</span></td></tr> <tr> <td><span>&amp;eacute;</span></td> <td><span>é</span></td> <td><span>Lowercase e, acute accent</span></td></tr> <tr> <td><span>&amp;ecirc;</span></td> <td><span>ê</span></td> <td><span>Lowercase e, circumflex accent</span></td></tr> <tr> <td><span>&amp;egrave;</span></td> <td><span>è</span></td> <td><span>Lowercase e, grave accent</span></td></tr> <tr> <td><span>&amp;euml;</span></td> <td><span>ë</span></td> <td><span>Lowercase e, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;iacute;</span></td> <td><span>í</span></td> <td><span>Lowercase i, acute accent</span></td></tr> <tr> <td><span>&amp;icirc;</span></td> <td><span>î</span></td> <td><span>Lowercase i, circumflex accent</span></td></tr> <tr> <td><span>&amp;igrave;</span></td> <td><span>ì</span></td> <td><span>Lowercase i, grave accent</span></td></tr> <tr> <td><span>&amp;iuml;</span></td> <td><span>ï</span></td> <td><span>Lowercase i, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;ntilde;</span></td> <td><span>ñ</span></td> <td><span>Lowercase n, tilde</span></td></tr> <tr> <td><span>&amp;oacute;</span></td> <td><span>ó</span></td> <td><span>Lowercase o, acute accent</span></td></tr> <tr> <td><span>&amp;ocirc;</span></td> <td><span>ô</span></td> <td><span>Lowercase o, circumflex accent</span></td></tr> <tr> <td><span>&amp;ograve;</span></td> <td><span>ò</span></td> <td><span>Lowercase o, grave accent</span></td></tr> <tr> <td><span>&amp;oslash;</span></td> <td><span>ø</span></td> <td><span>Lowercase o, slash</span></td></tr> <tr> <td><span>&amp;otilde;</span></td> <td><span>õ</span></td> <td><span>Lowercase o, tilde</span></td></tr> <tr> <td><span>&amp;ouml;</span></td> <td><span>ö</span></td> <td><span>Lowercase o, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;szlig;</span></td> <td><span>ß</span></td> <td><span>Lowercase sharp s, German (sz ligature)</span></td></tr> <tr> <td><span>&amp;thorn;</span></td> <td><span>þ</span></td> <td><span>Lowercase thorn, Icelandic</span></td></tr> <tr> <td><span>&amp;uacute;</span></td> <td><span>ú</span></td> <td><span>Lowercase u, acute accent</span></td></tr> <tr> <td><span>&amp;ucirc;</span></td> <td><span>û</span></td> <td><span>Lowercase u, circumflex accent</span></td></tr> <tr> <td><span>&amp;ugrave;</span></td> <td><span>ù</span></td> <td><span>Lowercase u, grave accent</span></td></tr> <tr> <td><span>&amp;uuml;</span></td> <td><span>ü</span></td> <td><span>Lowercase u, dieresis or umlaut mark</span></td></tr> <tr> <td><span>&amp;yacute;</span></td> <td><span>ý</span></td> <td><span>Lowercase y, acute accent</span></td></tr> <tr> <td><span>&amp;yuml;</span></td> <td><span>ÿ</span></td> <td><span>Lowercase y, dieresis or umlaut mark</span></td></tr></tbody></table></td></tr></tbody></table></p> **************************************************************************************************-->
|
<
|
< |
小于号
|
>
|
> |
大于号
|
&
|
&
|
和
|
'
|
'
|
单引号
|
"
|
"
|
双引号
|