• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

CFML question - parsing string

I have a variable named 'string' that contains a string of text. Within that string is a tag <SPLIT>

The string is basically two different strings joined by the <split> tag.

I need to display the string in the two parts. The part before <SPLIT> and the part after.

I'm curious if I can run, during a cfoutput tag, a function directly on the variable to grab the desired section. This way I could avoid creating two new variables. I'm not quite sure what function to use to parse the string, find <split> and capture what is to the right or left of it.

Method 1

<cfset part1 = function(#string#)>
<cfset part2 = function(#string#)>

<cfoutput>#part1#</cfoutput>
<cfoutput>#part1#</cfoutput>


Method 2

<cfoutput>part1(#string#)</cfoutput>
<cfoutput>part2(#string#)</cfoutput>

What function would be best used to parse the string and grab the section before <split> and after <split>
 
Back
Top