Qsorb
asked on
URGENT request to remove unwanted line feed after expansion of variable
<cfquery name="GetStory" datasource="qNEWS">
select top 1 *
from bnews
where ID = '#ID#'
and online = 1
order by id desc
</cfquery>
<cfoutput query="GetStory">
<cfset defaultbreakpos = len(GetStory.Story_body)*.6>
<cfif NOT mid(GetStory.story_body, defaultbreakpos, 1) is " ">
<cfset temppos = refindnocase("[\s]", reverse(left(GetStory.story_body, defaultbreakpos)))>
<cfset breakpos = defaultbreakpos-temppos+1>
<cfelse>
<cfset breakpos = defaultbreakpos>
</cfif>
<cfset toptext = left(GetStory.story_body, breakpos)>
#ParagraphFormat(toptext)# <a href="#GetStory.URL_LINK#" target="_blank">Read more</a>
</cfoutput>
The "Read more" line needs to be on the same line as the last line of the story_body. As it is now, it's always moved down one line.
I don't want to remove all the line feeds in the story as they're needed. I only want to remove the last line break, if possible, or do this a different way.
Show me how to do this with my code snippet.
remove paragraphformat and it will display just rightafter its ending
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
myselfrandhawa: Of course I need the ParagraphFormat so that won't work.
Dgrafx: That's exactly what I waned. Thanks!
Dgrafx: That's exactly what I waned. Thanks!