asp.net a byte check for text that contains a full half of the word _ practical tips
Source: Internet
Author: User
'''------------------------------------------------------------------------
"' <summary>
"' Text length check (check by byte)
"' </summary>
"<param name=" Argstrcontrol "> Text columns </param>
"" <param name= "arglength" > Text length </param>
"' <returns>true--, False--</returns>
"' <remarks></remarks>
'''------------------------------------------------------------------------
Public Shared Function Checkcontrollength (ByVal Argstrcontrol as String, _
Optional ByVal arglength as Integer = 0) as Boolean
' NULL
If String.IsNullOrEmpty (Argstrcontrol) Then
Return True
End If
' The text grows
Dim ilength as Integer = 0
Ilength = Pencoding.getbytes (Argstrcontrol). Length ()
' Text length check
If Arglength < Ilength Then
Return False
End If
Return True
End Function
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