Skip to main content
Participating Frequently
January 14, 2009
Question

What function I have to use?

  • January 14, 2009
  • 1 reply
  • 346 views
Hello to All!!!
What function I'd have to use, if I want:

I have simple variable
myvar = "I have a dog, cat"

I want to change "myvar" to myvar="I have a dog"
BUT I want to achieve this result without using "replace" functions because I don't want to input replace strings
I just want to put only strings, that I have to DELETE from myvar, so I don't want to use "substring2"
In ideal, the function can look like:
function(string, "value for deleting from string")
Does CF8 has a function like this???

Thanks for your answers!!!

This topic has been closed for replies.

1 reply

Participant
January 16, 2009
vovasvv,

Coldfusion does not natively have a function to complete that exact function.

The easiest way to complete that operation is definitely to just do a replace call.

This could also be achieved by using reg ex functions but, that would then require you to do substring operations which would be easily 5 times as many lines of code as just using replace.


Andrew Forrest
Application Developer
aforrest@hostmysite.com
<a href=” http://www.HostMySite.com?utm_source=bb”> www.HostMySite.com</a>