'Set printlength for total number of character to be displayed
printLength = 4
'Source String
myString ="12345678ABCDEFGHIJ"
'Logic
stringLength = len(myString)
for i =0 to stringLength / printLength
myAns = myAns & vbcrlf & mid(myString ,i*printLength +1,printLength)
next
msgbox myAns
printLength = 4
'Source String
myString ="12345678ABCDEFGHIJ"
'Logic
stringLength = len(myString)
for i =0 to stringLength / printLength
myAns = myAns & vbcrlf & mid(myString ,i*printLength +1,printLength)
next
msgbox myAns
OUTPUT - message box with these output
=======
1234
5678
ABCD
EFGH
IJ
No comments:
Post a Comment