Two functions that control the display format (word wrap, auto omit)

Source: Internet
Author: User
Tags word wrap
1 function: Rowscode ()-----display n letters per line, wrapping automatically
Function Rowscode (Str,n)
If len (str) <=N/2 Then
Rowscode=str
Else
Dim Tstr
Dim L,t,c
Dim I
L=len (str)
Tstr= ""
T=0
For I=1 to L
C=ASC (Mid (str,i,1))
If C<0 then c=c+65536
If c>255 Then
T=t+2
Else
T=t+1
End If
tstr=tstr& (Mid (str,i,1))
If T>n Then
tstr=tstr& "<br>"
T=0
End If
Next
Rowscode= Tstr
End If
End Function
2 function: lefttrue ()-----If the length of string Str is greater than n, display the n characters on the left
Function Lefttrue (Str,n)
If len (str) <=N/2 Then
Lefttrue=str
Else
Dim Tstr
Dim L,t,c
Dim I
L=len (str)
Tstr= ""
T=0
For I=1 to L
C=ASC (Mid (str,i,1))
If C<0 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

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.