2011-01-19 62 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

相关问题