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

String Concatenation

Former Member
0 Likes
1,015

Hi Experts:

How can i concatenate single quote ( ' ) with my string .

Ex: votre bon d'achat -


> This is my string name as Str.

if i assign this to Str

str = 'votre bon d'achat' .

it throws error ( Incorrect arithmetic or bit expression: Instead of "ACHAT", an operator . because the string contains Single Quote ( ' ) .

Please throw some light on it.

Thanks,

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
967

use 4 single quotes to get one single quote ...

concatenate 'votre bon d' '''' 'achat' into str.

8 REPLIES 8
Read only

Former Member
0 Likes
968

use 4 single quotes to get one single quote ...

concatenate 'votre bon d' '''' 'achat' into str.

Read only

0 Likes
967

Great !!!

Thanks Srini Vas

Regards,

Venkat

Read only

0 Likes
967

Sorry, I have posted in the wrong place.

Edited by: Dicso Luiza Alexandra on Feb 24, 2009 10:59 AM

Read only

former_member222860
Active Contributor
0 Likes
967

Hi,

data: str type string.
str = 'votre bon d''achat' .
write:/ str.

Read only

Former Member
0 Likes
967

Hi:

Use ` (just below ~) instead of ' .

Regards

Shashi

Read only

Former Member
0 Likes
967

Hi ,

You can use concatenate command.

Here is a sample code

data : str type string.


concatenate 'votre bon d' '''' 'achat' into str.
WRITE STR.

Regards

Arun

Read only

Former Member
0 Likes
967

concatenate '''' 'votre bon d' '''' 'achat' '''' into str.

Read only

Former Member
0 Likes
967

If u want ' after d try this

concatenate 'votre bon d~achat' into str.

or

If u want ' for both sides of string

concatenate 'votre bon dachat~' into str.