I am attempting to parse a string to extract the File name.
My Code:
For some reason, MyPos always returns "-1".
Log:
My Code:
B4X:
Sub btnFindEn_Action
fc.setExtensionFilter("Image", Array As String("*.png", "*.png"))
Dim f As String = fc.ShowOpen(MainForm)
If f <> "" Then
If f.EndsWith(".png") Then
Dim MyPos As Int
MyPos = f.LastIndexOf("/")
Log(MyPos)
Log(File.GetUri("Got: " & f, ""))
End If
End If
End Sub
Log:
B4X:
Waiting for debugger to connect...
Program started.
-1
file:/C:/Software/B4J/ENCRYP~1/Objects/Got:%20C:/Test/test2.png