好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > asp 字符串截取函數

asp 字符串截取函數

熱門標簽:福建外呼增值業務線路 伊春外呼業務系統 調度系統外呼 宜賓語音外呼系統軟件 河北智能外呼系統軟件 綿陽防封電銷卡價格 電銷機器人教育 電銷機器人源碼網盤下載 中國辦理電信400電話
asp 字符串截取函數
'*********************************************************
'函數:cutStr[str(strlen)]
'參數:str,待處理的字符串,strlen,截取的長度
'作者:木木
'日期:2007/7/12
'描述:截取指定長度的字符串
'示例:%=cutStr("歡迎光臨阿里西西",5)%>

'*********************************************************

function cutStr(str,strlen)
 If str = "" Then
 cutStr = "cutStr函數異常:字符串為空"
 exit function
 End If
'------------來源長度檢查
 If  strlen = "" Then
 cutStr = "cutStr函數異常:長度未指定"
 exit function
 End If 

 If  CInt(strlen) = 0 Then
 cutStr = "cutStr函數異常:長度為0"
 exit function
 End If 
'----------檢測來源字符長度
 dim l,t,c,i
 l=len(str)
 t=0
'----------循環截取字符
 for i=1 to l
 c=Abs(Asc(Mid(str,i,1)))
 '------判斷是否漢字
 if c>255 then
 t=t+2
 else
 t=t+1
 end If
 '------判斷是否到達指定長度
 if t>=strlen then
 cutStr=left(str,i)".."
 exit for
 else
 cutStr=str
 end if
 next
 cutStr=replace(cutStr,chr(10),"")
end function
''*********************************************************
'函數:strlen[str]
'參數:str,待處理的字符串
'作者:木木
'日期:2007/7/12
'描述:判斷字符串長度,漢字長度為2
'示例:%=strlen("歡迎光臨阿里西西")%>
'*********************************************************
Function strlen(str)
dim p_len
p_len=0
strlen=0
if trim(str)>"" then
p_len=len(trim(str))
for xx=1 to p_len
if asc(mid(str,xx,1))0 then
strlen=int(strlen) + 2
else
strlen=int(strlen) + 1
end if
next
end if
End Function
截取左邊的n個字符'*********************************************************
'函數:LeftTrue(str,n)
'參數:str,待處理的字符串,n,截取的長度
'作者:木木
'日期:2007/7/12
'描述:顯示左邊的n個字符(自動識別漢字)函數
'示例:%=LeftTrue("歡迎光臨阿里西西",6)%>
'*********************************************************

Function LeftTrue(str,n)
If len(str)=n/2 Then
 LeftTrue=str
Else
 Dim TStr
 Dim l,t,c
 Dim i
 l=len(str)
 t=l
 TStr=""
 t=0
 for i=1 to l
  c=asc(mid(str,i,1))
  If c0 then c=c+65536
  If c>255 then
  t=t+2
  Else
  t=t+1
  End If
  If t>n Then exit for
  TStr=TStr(mid(str,i,1))
 next
 LeftTrue = TStr
End If
End Function


您可能感興趣的文章:
  • asp截取字符串的兩種應用
  • asp下實現截取字符串特定部分內容函數
  • GetBody asp實現截取字符串的代碼
  • 用asp實現的截取指定格式字符串的代碼
  • asp從字符串里截取N個帶HTML的字符的函數
  • asp截取指定英漢混合字符串_支持中文
  • ASP.NET 字符串截取
  • asp CutStrX字符串截取函數(過濾全部HTML標記)
  • asp實現截取字符串函數

標簽:電商邀評 銅川 那曲 蘇州 新鄉 河池 延邊 優質小號

巨人網絡通訊聲明:本文標題《asp 字符串截取函數》,本文關鍵詞  asp,字符串,截取,函數,asp,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp 字符串截取函數》相關的同類信息!
  • 本頁收集關于asp 字符串截取函數的相關信息資訊供網民參考!
  • 推薦文章