I have many strings that look like this: word1_word2. I want a function that takes this string and returns word1 And, I also want a function that returns word2 I imagine there is a function like Findbefore(string," _") and Findafter(string,"_") But I know that is not right. What Coldfusion functions exist to do this?
A list function would work <cfset myString = "word1_word2"> <cfoutput> returns word1 = #ListFirst(myString, "_")# <br> returns word2 = #ListGetAt(myString, 2, "_")# <br> </cfoutput> http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi13.htm