This should work.
<cfset TestSTring = "domain.com<br/>www.facebook.com/facebookpage<br/>http://instagram.com/instagrampage">
<cfset a = TestString.Split("<br/>")>
The reason ListtoArray
is displaying 11 items is because ColdFusion treats each character in the delimiter string (<br/>
) as a separate delimiter
Based on @Leigh's comment updating my answer to ensure people should learn the Coldfusion APIs rather than fiddling with Java functions, <cfset a = ListToArray(TestString, "<br/>", false, true)>
will also work. Thanks Leigh.
Note: The false
at the end is for the includeEmptyFields
flag and the true
is for the multiCharacterDelimiter
flag. See the docs.