截取字符参考代码
<P><%<BR>function calc(num1,num2)<BR>num3=num1+num2<BR>calc=num3<BR>end function<BR>'a=1<BR>'b=2<BR>'c=a+b<BR>'response.Write(a&"+"&b&"="&c)<BR>a=1<BR>b=3<BR>response.Write(a&"+")<BR>response.Write(b&"=")<BR>response.Write(calc(a,b))<BR>%></P><P><BR><script language="JavaScript" type="text/JavaScript"><BR><!--<BR>function del()<BR>{var bigbird = window.confirm("删除管理员之后不可恢复,确定删除请按“确认”键!");<BR> if ( false == bigbird )<BR> {<BR> return false;<BR> }<BR>}</P>
<P><BR><%<BR>' ============================================<BR>' 取实际字符长度<BR>' ============================================<BR>Function GetLen(str,num1)<BR>Dim l, t, c, i,num2<BR>num2=num1<BR>str2=str<BR>l = Len(str)<BR>t = l<BR>For i = 1 To l<BR>c = Asc(Mid(str, i, 1))<BR>If c < 0 Then c = c + 65536<BR>If c > 255 Then t = t + 1<BR>Next<BR>If t>num2 then<BR>GetLen=left(str2,num2)<BR>Else<BR>GetLen=str2<BR>End If<BR>End Function</P>
<P>t1="一二三四五六七八九十"<BR>t2="1234567890"<BR>%></P>
<P><table border="1" cellspacing="0" cellpadding="0"><BR><tr><BR> <td height="20">名</td><BR> <td>内容</td><BR> <td>len()</td><BR> <td>lenB()</td><BR> <td>GetLen()</td><BR></tr><BR><tr><BR> <td width="31">t1</td><BR> <td width="186"><BR><%<BR>response.Write(t1)<BR>%><BR></td><BR> <td width="105"><%=len(t1)%></td><BR> <td width="105"><%=lenB(t1)%></td><BR> <td width="105"><%=GetLen(t1,10)%></td><BR></tr><BR><tr><BR> <td height="20">t2</td><BR> <td><BR><%<BR>response.Write(t2)<BR>%></td><BR> <td><%=len(t2)%></td><BR> <td><%=lenB(t2)%></td><BR> <td><%=GetLen(t2)%></td><BR></tr><BR></table><BR></P> 请问站长ASP.NET好还是ASP好 <P>当然.NET 好了因为ASP 首先ASP 是明文显示的 也就是说 我只要给你源代码 ,你用记事本 就可以看, NET可以封装成DEL文件 安全性高, 其次 NET开发容易.好处还很多 ,自己学的时候慢慢在体会把. </P>
[此贴子已经被作者于2006-4-7 23:08:53编辑过]
不错,顶楼主..........
不错,顶楼主..........http://www.domain.cn/club/images/default/sigline.gif
古之立大事者,不惟有超世之才,亦必有坚忍不拔之志。---魔兽剑圣异界纵横
小游戏 极品家丁 龙蛇演义 恶魔法则 飞升之后 异界枪神 凡人修仙传 魔兽领主 超级农民 成人小游戏 极品公子
页:
[1]