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

What function I have to use?

New Here ,
Jan 14, 2009 Jan 14, 2009
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!!!

TOPICS
Getting started
330
Translate
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
New Here ,
Jan 16, 2009 Jan 16, 2009
LATEST
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>
Translate
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