Sub GetFilename(fullpath As String) As String
Return fullpath.SubString(fullpath.LastIndexOf("/") + 1)
End Sub
' results in image1.png
B4X:
Sub GetBasename(fullpath As String) As String
Dim filename As String
filename = GetFilename(fullpath)
Return filename.SubString2(0,filename.LastIndexOf("."))
End Sub
' Depends on: GetFilename
' Example
'Log(GetBasename("http://www.domain.tld/SomePage.html")) ' -> SomePage
You now just need to extract the number at the end
Sub GetFilename(fullpath As String) As String
Return fullpath.SubString(fullpath.LastIndexOf("/") + 1)
End Sub
' results in image1.png
B4X:
Sub GetBasename(fullpath As String) As String
Dim filename As String
filename = GetFilename(fullpath)
Return filename.SubString2(0,filename.LastIndexOf("."))
End Sub
' Depends on: GetFilename
' Example
'Log(GetBasename("http://www.domain.tld/SomePage.html")) ' -> SomePage
You now just need to extract the number at the end