Multiline strings

Post Reply
basica
Posts: 2
Joined: Wednesday 24th June 2020 2:23pm

Multiline strings

Post by basica » Wednesday 24th June 2020 2:27pm

I did a quick google search and I found and old mailing list thread that seems to indicate it wasn't possible at the time (back in 2013) but I was wondering whether there's a straightforward way to doing it now?

User avatar
cogier
Site Admin
Posts: 466
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Multiline strings

Post by cogier » Wednesday 24th June 2020 5:07pm

Hi and welcome to the forum.

You can do multiline strings, here are a couple of examples: -
Dim sString As String[] = ["I did a quick google search and I found and old mailing list thread that seems to indicate it wasn't possible at the time (back in 2013)",
    "but I was wondering whether there's a straightforward way to doing it now?"]

Dim sS As String = "I did a quick google search and I found and old mailing list thread" &
    " that seems to indicate it wasn't possible at the time (back in 2013)" &
    "but I was wondering whether there's a straightforward way to doing it now?"

User avatar
stevedee
Posts: 209
Joined: Monday 20th March 2017 6:06pm

Re: Multiline strings

Post by stevedee » Thursday 25th June 2020 7:19am

...and you can naturally do stuff like this:-
Public Sub Button1_Click()
Dim CatStevens As String

  CatStevens = "It's not time to make a change" & gb.CrLf &
  "Just relax, take it easy" & gb.CrLf &
  "You're still young, that's your fault" & gb.CrLf &
  "There's so much you have to know" & gb.CrLf

  TextArea1.Text = CatStevens
  

End

basica
Posts: 2
Joined: Wednesday 24th June 2020 2:23pm

Re: Multiline strings

Post by basica » Thursday 25th June 2020 9:30am

Cheers guys. Appreciate the responses.

Post Reply