Remove blank lines return from a sub

In VB script, I want to remove the blank lines from a sub routine when it is called in the main script.
For example: My VBscript reads like:
call sub1(argu1)

sub sub1(argu1)
End sub

The output of sub1 is like:
<blank line>
some data
other data
<blank line>
yet another data

How could I remove the <blank line> and make it feel better.

Thanks, ezlee
Who is Participating?
bhagyeshtConnect With a Mentor Commented:
change the sub to a function and instead of output from sub make the function return the output as  a string then replace it.
ie from
sub mysub
...some output mostly print or debug.print
end sub

function mysub
mysub=mysub+<output string>
end function
take the output in a string then call the following
strMystring=Replace(strMystring,vbcrlf & vbcrlf,vbcrlf)
then continue with the output
if the above doesnt work check what characters are in the blank line and prefex and suffex those characters with vbcrlf
ezleeAuthor Commented:
sorry, I am new in VB scripting,
could you give me more details?
the output that containing blank lines are from the "sub",
how can I do some trimming when I call it from main?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.