What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 37513 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > VB.NET > Function for Wraping the Text in Windows Application ...
Chikul

Function for Wraping the Text in Windows Application

 Code Snippet posted by: Chikul | Posted on: 11/29/2009 | Category: VB.NET Codes | Views: 616 | Status: [Member] | Alert Moderator   


' Purpose : Function for Wraping the Text in Windows Application
' Variable: Variable strin,charcount

Public Function wrap(ByVal strin As String, ByVal charcount As Integer) As String
Dim str As String = strin
strin = ""
Dim i As Integer
Dim cou As Integer = str.Length Mod charcount
If str.Length <= charcount Then
strin = str.Substring(0)
ElseIf str.Length > charcount Then
Dim n As Integer = str.Length - cou
For i = 0 To (n / charcount) - 1
strin += str.Substring((i * charcount), charcount) & Chr(13)
Next
If cou <> 0 Then
strin += str.Substring((i) * charcount, cou)
End If
End If
Return strin
End Function

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2013 4:51:57 PM