Len (), lift (), right () the user who does not recognize Chinese correctly please come in!

Source: Internet
Author: User
Tags exit
The following usage is in Chinese and 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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.