• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

replacenocase more than 1 substring

Explorer ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

Hi

I need to replace more than 1 substring.
At the moment my code looks like this...
#replacenocase(GetTemplate.message,'Good day','Good day #name#','all')#
#replacenocase(GetTemplate.message,'src="/UserFiles/','src=" http://www.forgebox.co.za/UserFiles/','all')#

It all needs to be in 1 replacenocase.

Please can someone assist me here. Its fairly urgent.

Regards
FlashD
TOPICS
Advanced techniques

Views

796

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 12, 2008 Nov 12, 2008
quote:

Originally posted by: Flashdakota
Hi

It needs to be inside 1 replacenocase as it inside a mail loop

Thankd
Delon

Run it twice inside the loop. You can either have separate commands or you can nest the function calls. You might be better off setting the result to a variable before the cfmail tag.

Votes

Translate

Translate
LEGEND ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

> At the moment my code looks like this...
> #replacenocase(GetTemplate.message,'Good day','Good day #name#','all')#
>
> #replacenocase(GetTemplate.message,'src="/UserFiles/','src=" http://www.forgebox.
> co.za/UserFiles/','all')#
>
> It all needs to be in 1 replacenocase.

Why's that?

> Please can someone assist me here. Its fairly urgent.

Did you read the docs for replaceNoCase()?

http://livedocs.adobe.com/coldfusion/8/functions_m-r_34.html

Did you look at what it suggests to "see also"?

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

Hi

It needs to be inside 1 replacenocase as it inside a mail loop

So whats happening is my mail appears twice inside 1 message with each replacenocase occurrence


Thankd
Delon

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

quote:

Originally posted by: Flashdakota
Hi

It needs to be inside 1 replacenocase as it inside a mail loop

Thankd
Delon

Run it twice inside the loop. You can either have separate commands or you can nest the function calls. You might be better off setting the result to a variable before the cfmail tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

Yes, i did see the docs...
It's easy enough replacing 1 substring... but not 2

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

Ok great!
Quite simple really.

Thanks it all worked 100%

I'll be back to answer questions.

Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

> Yes, i did see the docs...
> It's easy enough replacing 1 substring... but not 2

Back to what I said:
>> Did you look at what it suggests to "SEE ALSO"?

My wording is quite deliberate there.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

LATEST
I think he needs to REread what Adam said...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation