General discussion

Locked

"Fill String" Replicate Characters

By tcobbs ·
A recent article (yesterday?) described a VB program to replicate a pattern of characters into a string. Below is a "sub" version of the same program that uses recursion to run in fewer iterations on large strings.

Public Sub FillString( _
ByVal Value As String, _
ByVal StringLength As Integer, _
ByRef Result As String)

Result = Result & Value
Do While Len(Result) < StringLength
FillString Value & Value, StringLength, Result
Loop

Result = Left(Result, StringLength)
End Sub

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums