Skip to Content
author's profile photo Former Member
Former Member

String Concatenation

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 07:35 AM

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

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 24, 2009 at 07:36 AM

    Hi,

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 07:37 AM

    Hi:

    Use ` (just below ~) instead of ' .

    Regards

    Shashi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 07:37 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 07:38 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 07:43 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.