/build/static/layout/Breadcrumb_cap_w.png

how split string

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   [ + ] Show comments

Answers (1)

Posted by: captain_planet 12 years ago
Black Belt
1
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
Next

newstring = Trim(newstring)
wscript.echo newstring
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ