Skip to main content
April 11, 2011
Question

Manipulating String

  • April 11, 2011
  • 1 reply
  • 468 views

Hello, this is my first post here. i searched but couldnt find any solution about the case i explained below and i'll be happy if u guys help me. i need some help about how to manipulate a string which came from database.

for example check this some of code,

<cfquery name="query_name" datasource="source">

SELECT ARTICLE_BODY FROM ARTICLE WHERE ARTICLE_ID = 1

</cfquery>

here which i get the article as a variable. assume that; article body is: "lorem ipsum dolor sit amet"

i am printing out article by using cfoutput tag, for example:

<cfoutput query="query_name">

#article_body#

</cfoutput>

question is here; how can i display just a part of string? for instance i want to show only first word of query variable; "lorem" or just a part of it: "dolor sit" ?

What should i do? How can i manipulate string? which parameters i can use for manipulating? also i need to add some other stuff to variable, which way i should use?

Thank you so much.

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    April 11, 2011

    String functions

    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions-pt0_18.html#1099887