Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

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

Tags:
replied

Use STRLEN to determine the length of NAME and then put ADDRESS as many spaces over as needed.

Rob

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question