Skip to main content
Participant
September 25, 2008
Question

Parsing a string

  • September 25, 2008
  • 4 replies
  • 416 views
Hello,

I am writing my first application in ColdFusion. I am having a bit of trouble with the syntax to perform a function. I have a string: "abcdefghij". I would like to break it up into 3 seperate strings: "abc" "def" "ghij", but I can't figure out how to do this. Any guidance would be greatly appreciated. Thanks in advance!
    This topic has been closed for replies.

    4 replies

    Bachi_BoyAuthor
    Participant
    September 25, 2008
    Thanks all, I got it figured out googling it. I am a developer, so the logic I get, it's more or less the syntax changes that I am trying to pick up on. It's an inherited application that had to have mods made to it, and they needed them implemented asap. So, I was just hoping for a push in the right direction, and google helped. :)

    In case anyone else has the same issue, I did indeed use the right(), left(), mid() functions
    BKBK
    Community Expert
    Community Expert
    September 25, 2008
    Have a look at the Coldfusion string functions. You can do your magic with left(), mid(), removeChars() or right().

    Inspiring
    September 25, 2008
    google is your freind. to find out how a function works, search on "coldfusion function_name x" where x is the version number. It's optional.

    To find out how a tag works, search on "<cfTagName> x".

    The functions you need are left(), mid(), right(), and len().
    Inspiring
    September 25, 2008


    What part are you having trouble with? ColdFusion as all the standard
    string manipulation functions found in just about every programming
    language.
    [ http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Part_3_CFML_Ref_1.html
    They will easily do this depending on how exactly you want to do it.

    To be nice, I would probably make use of the standard left(), right()
    and mid() functions, but that is by no means the only way to skin this
    requirement.