Results 1 to 5 of 5

Thread: [RESOLVED] Multiple Replace Function Order

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    273

    Resolved [RESOLVED] Multiple Replace Function Order

    I want to do a multiple replace on one field in a table. I want to replace apos; and ampapos;. What would the order have to be to first replace ampapos;?

    Do I do replace(replace(description, 'apos;', ''''),'ampapos;', '''') or
    replace(replace(description, 'ampapos;', ''''),'apos;', '''')

    thank you.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Multiple Replace Function Order

    replace the longer word first so you are not left with unreplaced 'amp' tokens.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    273

    Re: Multiple Replace Function Order

    Thank you. What would the replace statement look like in order to replace those first?

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Multiple Replace Function Order

    Try your second line of code in post #1

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    273

    Re: Multiple Replace Function Order

    thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width