Is there a shorter way of appending information to an existing string?

Refresh

February 2019

Views

936 time

1

Is there a shorter way of appending information to an existing string in than:

strExample = strExample & "Lorem Ipsum"

I've got a lot of these when compiling dynamic strings, and it'd save time and look neater in my code if there was a shorter way of typing this.

Thanks

2 answers

1

You could set up a global string var and create a function to add on to just that string. It wouldn't save that much time coding, but it may be something that helps

Public strExample as String

Sub Main()
   {do something}
   AddTo("One")
   {do something else}
   AddTo("Two")
End Sub

Sub AddTo(str as String)
   strExample = strExample & str
End Sub
3

No sorry that is not possible.

With you can use the operator &=. But it is not available for .