Skip to Content
0
Sep 11, 2008 at 02:48 PM

How to add multiple spaces to the middle of a string?

4224 Views

Hi,

I have two strings:

str1 = 'NAME'

str2 = 'ADDRESS'

I want to create a third string:

str3 = 'NAME ADDRESS'

These do not work:

1) str3 = str1 + ' ' + str2

2) concatenate str1 ' ' str2 into str3

3) concatenate str1 ' ' str2 into str3 separated by space

4) str3 = 'NAME&ADDRESS'

replace '&' in str3 with ' '

5) str3 = 'NAME&ADDRESS'

overlay str3 with ' ' only '&'

Any other ideas?

Thx.

Andy