brucecrabtree
asked on
Do I need Chr(10) with Chr(13)?
I'm converting the commas in a list to line breaks (for display in a textarea) this way:
<cfset newlist2 = listChangeDelims(newlist," #chr(13)#" )>
Is it necessary to include chr(10) as well, like this:
<cfset newlist2 = listChangeDelims(newlist," #chr(10)## chr(13)#") >
When I do that I get double-spaced lines in the textarea, which I'd rather not have.
<cfset newlist2 = listChangeDelims(newlist,"
Is it necessary to include chr(10) as well, like this:
<cfset newlist2 = listChangeDelims(newlist,"
When I do that I get double-spaced lines in the textarea, which I'd rather not have.
Just use the chr(13) and if you get what you want then it is OK. The line breaks are coming from the extra char(10).
Using just Chr(13) isn't going to get the job done. Some operating systems need the Chr(10) to display things properly.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Jeff. Is Replace() better than listChangeDelims ?
It's not so much that it's better, it's that sometimes it'll yield more consistent results.
<cfscript>
newlist = 'foo,bar,boo,far,goo,car,c
newlist_listchangedelims = ListChangeDelims(newlist, Chr(13) & Chr(10));
newlist_replace = Replace(newlist, ',', Chr(13) & Chr(10), 'ALL');
</cfscript>
<cfoutput>
#WriteOutput(newlist_listc
</cfoutput>