Copy link to clipboard
Copied
Hi! I have a ColdFusion variable which contains a URL:
For example, it looks like <iframe width="640" height="360" src="//www.youtube.com/embed/XXXXXX" frameborder="0" allowfullscreen></iframe>.
What I'd like to do is replace the width of "640" with that of "450" and the height of "360" with "253". I'm passing a string into an "if" statement which will change the variables if the conditions are met. I CANNOT change the variables before making it a string. I must change the variables.
What is the best way to do this in ColdFusion? I don't know this language (my expertise is more in JavaScript and PHP), so I appreciate all the help you could give me.
Thank you for your help!
BP
Have a look at the Replace() function. It allows you to replace one substring with another.
Cheers
Eddie
Copy link to clipboard
Copied
Have a look at the Replace() function. It allows you to replace one substring with another.
Cheers
Eddie
Copy link to clipboard
Copied
Thank you very much! The Replace() worked just fine.
Copy link to clipboard
Copied
Can you share the code you are working with? It is a hard question to answer when we don't know the context.
Thanks,
--Dave
Copy link to clipboard
Copied
Thank you very much! The Replace() worked just fine.