Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Parsing a string

New Here ,
Sep 25, 2008 Sep 25, 2008
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!
385
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2008 Sep 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2008 Sep 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().
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2008 Sep 25, 2008
Have a look at the Coldfusion string functions. You can do your magic with left(), mid(), removeChars() or right().

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 25, 2008 Sep 25, 2008
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources