AdobeStock_455007340

A SubStr() Function

Home » A SubStr() Function

A thread of the forums (http://webforums.macromedia.com/coldfusion/messageview.cfm?catid=3&threadid=681710) turned into a request for a SubStr() function and a discussion as to why it did not exist. CFML does have a Mid() function, but the third parameter (the length) is required, and this is not the case in most SubStr() implementations. So, instead of working on what I was supposed to be working on, I threw a quick SubStr() function together. Honestly, I am not sure how useful this one is, but if you like it, use it. 🙂















One response to “A SubStr() Function”

  1. Faser Avatar
    Faser

    On cflib there is a substr that mimic the behaviour of php substr enclosing mid, left and right functionalities into a single function. People from PHP like it 🙂
    http://www.cflib.org/udf.cfm?ID=652

Leave a Reply