Create a function to convert a string to equal length (20 Characters) string by adding blank space at the end of the string.

Eg: strn = "dfsgjfhdgjkhsfdjkghsklfhgklsjdfhgjkshdfhgafhgkhfgafjhgjfhgkjhfgjhfhgfkghgkfghkh"

i want the out put string is : 20charters space 20charters 20charters space 20charters space

any one help pkzz
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Not perfect, but it's a start.....
Dim mystring : mystring = "kdjflgkeodisuehtnfj1kdlfkeiruthgndmsndh2jrutigonsnauasisand3aiondansdhmisa"
Dim newstring : newstring = ""

For i = 1 to Len(mystring)
If i Mod 20 = 0 Then
newstring = newstring & mid(mystring,(i-19),20) & " "
End If

newstring = Trim(newstring)
wscript.echo newstring
Answered 07/08/2011 by: captain_planet
Fourth Degree Brown Belt

Please log in to comment