• Welcome to Valhalla Legends Archive.
 

Multi-Lined string

Started by CrAz3D, December 31, 2003, 07:12 PM

Previous topic - Next topic

CrAz3D

vb6

This is my string:


bob OP
cheese OS
2xx-craz3d MOSXLEIP
me OF

It has a blank line @ the top as you can see.  How would I remove this blank line, any ideas?

I tried Replace(string, " ", "word") but then realized that there are other spaces that need to stay.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

hismajesty

Open the text file, move your cursor to the line that's blank, hit 'del'

Grok

If it is a blank line, and not one with a space ...

Buffer = Replace(buffer, vbCrlf & vbCrlf, vbCrlf)

CrAz3D

OOh, thank you.
I also got this from CupHead:
While Left(UserList, 2) = vbCrLf
                                   UserList = Right(UserList, Len(UserList) - 2)
                               Wend
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Grok

Quote from: CrAz3D on January 01, 2004, 10:09 AM
OOh, thank you.
I also got this from CupHead:
While Left(UserList, 2) = vbCrLf
                                   UserList = Right(UserList, Len(UserList) - 2)
                               Wend


His loop is better because it gets rid of all blank lines, where the single replace gets rid of only scattered instances.

CrAz3D

rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...