Link to home
Start Free TrialLog in
Avatar of ezlee
ezlee

asked on

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
Avatar of bhagyesht
bhagyesht
Flag of India image

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
Avatar of ezlee
ezlee

ASKER

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?

thanks  
ASKER CERTIFIED SOLUTION
Avatar of bhagyesht
bhagyesht
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial