2011-01-19 63 views

回答

0

Joe我使用listToArray函數,傳遞「/」作爲分隔符,獲取數組的長度並獲取最後一個槽中的值。見下面

<cfset str = "http://domain.com/g34/abctest.html"/> 
<cfset arr = ListToArray(str,"/","false")/> 
<cfset val = arr[ArrayLen(arr)]/> 
<cfoutput>#str# : #val#</cfoutput> 

樣品產生

http://domain.com/g34/abctest.html:abctest.html

7

嗯,有點怪幾天之內給出非常類似的答案,但ListLast看起來最緊湊和最直接的方法:

<cfset filename = ListLast("http://domain.com/g34/abctest.html","/") /> 

是的,國際海事組織你應該開始this page之前問這樣的問題上S O.

+0

不錯!更好的解決方案 – KobbyPemson 2011-01-19 16:52:24

相關問題