0

I searched but nothing explains how to do this, for example

Dim sentence as String = "cat is an animal"

if i make a msgbox :

MsgBox(sentence)

it shows

cat is an animal

how to make a msgbox that says

cat
is
an
animal.
digEmAll
  • 56,430
  • 9
  • 115
  • 140
Emoticon
  • 26
  • 1
  • 5

1 Answers1

0

Easy way Replace space with new line

as in string words = MyString.Replace(" ","\r\n")

Split would be split on space in to an array , and then join that back up with new lines which is pointless unless you need the array for something else.

Tony Hopkinson
  • 20,172
  • 3
  • 31
  • 39
  • I got the code : Dim sentence2 As String = "cat is an animal" Dim sentence = sentence2.Replace(" ", vbNewLine) MsgBox(sentence) – Emoticon Mar 25 '12 at 12:44
  • 1
    Well there you go, you learnt something. Satisfying isn't it? Much more so than someone just giving you AN answer. I can think of loads of ways of doing what you asked, mainly because I got off my arse and learnt them. "Just gimme the code", sheesh – Tony Hopkinson Mar 25 '12 at 17:06