Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Concatenate ???

Former Member
0 Likes
1,007

hi there.....

i want to concatenate ' with a string. how can i do that....

i mean ...

supppose i hav str1 = 'string'.

i want to do

concatenate ' str1 ' into str2. to get

str2 = ''string''.

thanks and regards

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
985

you need four apostrophes:

CONCATENATE '''' str1 '''' INTO str2.

hi there.....

i want to concatenate ' with a string. how can i do that....

i mean ...

supppose i hav str1 = 'string'.

i want to do

concatenate ' str1 ' into str2. to get

str2 = ''string''.

thanks and regards

7 REPLIES 7
Read only

JozsefSzikszai
Active Contributor
0 Likes
986

you need four apostrophes:

CONCATENATE '''' str1 '''' INTO str2.

Read only

Former Member
0 Likes
985

perhaps

supppose i hav str1 = 'string'.

i want to do

concatenate ''' str1 '' into str2. to get

str2 = ''string''.

Read only

Former Member
0 Likes
985

If your query is as follows :

str1 = string

and you want str2 = "string1" i.e., if you want to concatenate only double quotes (") at the beginning and at the end of the string. Then you can refer this code snippet.

DATA str1(10) VALUE 'string1'.

DATA str2(13) TYPE c.

CONCATENATE '"' str1 '"' INTO str2.

WRITE str2.

Now str2 will contain "string1".

Read only

Former Member
0 Likes
985

hey thr.... plz note i want to concatenate single quotes nd not double....

Read only

0 Likes
985

Prem:

1. pls. answer to the person you "talk" to, not to yourself (to make it clear, who do you address your comment)

2. First try out, if the advise works, after that you can still comment in case it does not work...

Read only

Former Member
0 Likes
985

Hi,

As per your requirement use the following statement

concatenate '''''' string1 '''''' into string2.

Here u will get the result like string2 = ''string''.

Regards,

Kumar

Read only

Former Member
0 Likes
985

Hi,

I dont understand the requirement...

Anyways

CONCATENATE '"' str1 '"' INTO str2.

Thanks,

Krishna...