AS P面向对 象编程class类Function过程.docVIP

  • 3
  • 0
  • 约8.38万字
  • 约 75页
  • 2019-01-18 发布于湖北
  • 举报
‘‘==================ASP类Class过程取除左右括号============================ Function getReplace(Str) Str = Replace(Str,(,) Str = Replace(Str,),) getReplace = Trim(Str) End Function ‘‘==================ASP类Class过程取出数组中字符组成带括号的新字符========= Function getNewStr(tempArr) temp = For i = 0 To UBound(tempArr) If temp = Then temp = ( tempArr(i) ) Else temp = temp ,( tempArr(i) ) End if Next getNewStr = temp End Function ‘‘==================ASP类Class过程生成数组放入sql查询语句================== Function getInsql(tempArr) temp = if isarray(tempArr) then for i = 0 to ubound(tempArr) if temp = then temp = tempArr(i) else temp = temp , tempArr(i) end if next end if getInsql = temp End Function ‘‘==================ASP类Class过程============================== ================字符串处理======================= ‘‘==================ASP类Class过程============================== 截取一定长度的字符串 Str为字符串,length为长度 Function cutStr(Str,Length) If len(Str)Length Then cutStr=left(Str,Length)... Else cutStr=Str End If End Function 格式化文本输出,如空格、换行 Function outputStr_BR(str) If str Then outputStr_BR=Server.HTMLEnCode(str) outputStr_BR=Replace(outputStr_BR, ,nbsp;) outputStr_BR=Replace(outputStr_BR,chr(13),br) Else outputStr_BR= End If End Function 字符安全处理 Function SafeStr(str,IfTrim) Dim temp temp=Replace(str,,) If IfTrim Then temp=Trim(temp) End If SafeStr=temp End Function 不够宽度用空格填充“nbsp;”,区分汉字(2个字长)、字母(1个字长) Function FormatLen(str,length) Dim temp,tempLen,i temp=str tempLen=len(str) i=tempLen While i0 If len(temp)0 And Asc(right(temp,1))0 Then tempLen=tempLen+1 End If i=i-1 temp=left(temp,i) Wend If tempLenlength Then temp=Replace(Space(length-tempLen), ,nbsp;) End If FormatLen=strtemp End Function 返回半字长度 Function lLen(str) Dim temp,tempLen,i tempLen=0 temp=str While Len(temp)0 If Asc(Left(temp,1))0 Then tempLen=tempLen+2 Else tempLen=tempLen+1 End If temp=Right(temp,Len(temp)-1) Wend lLen=tempLen End Function 返回定长的HTML格式空格

文档评论(0)

1亿VIP精品文档

相关文档