Abh*_*jan 4 coldfusion coldfusion-9 cfml
在CF9中,我有一个字符串 C:\Docs\472837\nyspflsys\Medical Report\XLSX_46.xlsx
我想最后一个反斜杠来分割它,所以它看起来应该
array[1] = C:\Docs\472837\nyspflsys\Medical Report 和
array[2] = XLSX_46.xlsx
如何在ColdFusion 9中完成?
您可能需要考虑使用GetDirectoryFromPath和GetFileFromPath.
<cfset fullPath = "C:\Docs\472837\nyspflsys\Medical Report\XLSX_46.xlsx">
<cfset dirPath = getDirectoryFromPath(fullPath)> <!--- C:\Docs\472837\nyspflsys\Medical Report\ --->
<cfset dirPath = reReplace(dirPath, "[\\/]$", "")> <!--- C:\Docs\472837\nyspflsys\Medical Report --->
<cfset fileName = getFileFromPath(fullPath)> <!--- XLSX_46.xlsx --->
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
590 次 |
| 最近记录: |