tags:

views:

30

answers:

1

Example:

MY NAME IS STACKOVERFLOW

Results in:

MY(new line)
NAME(new line)
IS(new line)
STACKOVERFLOW(new line)

or

Example:

MY-NAME-IS-STACKOVERFLOW

Results in:

MY(new line)
NAME(new line)
IS(new line)
STACKOVERFLOW(new line)

I want to split the line into multiple lines using either a space or dash or whatever it is.

+2  A: 

VB6:

if InStr(originalstring, "-") <> 0 Then
    newstring = Replace$(originalstring, "-", vbCrLf)
else
    newstring = Replace$(originalstring, " ", vbCrLf)

If you are using VB.NET, then you can use the String.Split() method.

Mitch Wheat
thanks very much for the answer...i'm a beginner...is this code can be use for list box...because i wanna use 2 list box...the first list box for the original and the second as the result...
iya_dech