导航: 好喜爱学习网 >> 网站制作 >> asp教程 >> 字符串函数不能正常识别中文的解决方法
相关文章
最新文章
文章内容
字符串函数不能正常识别中文的解决方法
作者:未知 来源:网络收集 录入:管理员
以下函数用法和len(),lift(),right()一样。

Function Strlength(Str)
  Temp_Str=Len(Str)
  For I=1 To Temp_Str
    Test_Str=(Mid(Str,I,1))
    If Asc(Test_Str)>0 Then
      Strlength=Strlength+1
    Else
      Strlength=Strlength+2
    End If
  Next
End Function


Function Strleft(Str,L)
  Temp_Str=Len(Str)
  For I=1 To Temp_Str
    Test_Str=(Mid(Str,I,1))
    Strleft=Strleft&Test_Str
    If Asc(Test_Str)>0 Then
      lens=lens+1
    Else
      lens=lens+2
    End If
    If lens>=L Then Exit For
  Next
End Function

Function Strright(Str,L)
  Temp_Str=Len(Str)
  For i = Temp_Str to 1 step -1
    Test_Str=(Mid(Str,I,1))
    Strright=Test_Str&Strright
    If Asc(Test_Str)>0 Then
      lens=lens+1
    Else
      lens=lens+2
    End If
    If lens>=L Then Exit For
  Next
End Function

E-MAIL:309076721@163.com
本站为非营利性质个人网站,建站只为个人爱好与学习,内容大多为电脑技术教程;
网站内容来源于互联网收集整理,禁止用于非法途径,如发现本网站上有侵权的文章请联系我们,我们会尽快删除;
本站不对站点内容准确性、完整性和真实性作任何承诺,由此产生的后果本站不承担任何责任,对以上引起的一切法律纠纷本站无权利承担。