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

Refresh

5 days ago

Views

901 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

3

Нет жаль , что не представляется возможным .

С вы можете использовать оператор &=. Но оно не доступно для .

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