Question : Display particular data in string

I'm annoyed now that I can't get this...it works in other places on my site and for whatever reason it's not working now.

I have a file name that displays a session key and then the file name, so it displays as "882AFB3103E10DC0015168C165804FEC-THIS IS THE FILE NAME.doc".  I am trying to display this file name as "THIS IS THE FILE NAME.doc" only, removing the session key and dash.

Instead of getting just the file name without the session key, I get an error:
           The 2 parameter of the Right function, which is now -22, must be a positive integer
1:
2:
3:
4:
5:
6:
7:
<cfdirectory action="list" 
             directory="#GetDirectoryFromPath(GetCurrentTemplatePath())#Library\documents\"
             name="docName" />
<cfoutput>
<cfset FileName = 'docName.Name'>
#right(FileName, LEN(FileName)-33)#
</cfoutput>

Answer : Display particular data in string

Hmm.... actually listRest() is better.  It'll handle cases where the file name portion contains a dash.

ie
882AFB3103E10DC0015168C165804FEC-THIS FILE NAME-CONTAINS-LOTS-OF-DASHES.doc
<cfset fileName = listRest(docName.name, "-")>
Random Solutions  
 
programming4us programming4us