truncating a file name - extension
-
27-10-2019 - |
Question
I have a file being loaded into fd.ChosenName and wondering if there is a quick solution such as an opposite to stringbuilder to truncate a file name (extension) for display purposes. So if the value of fd.ChosenName is picture1.jpg I could actually display the text picture1 in a panel etc.
Solution
str.SubString2(0, str.LastIndexOf("."))
Edited for correct answer
SubString2 takes 2 parameters, beginIndex and endIndex
Reference: http://www.basic4ppc.com/android/help/core.html#string
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow