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.
Asked
Active
Viewed 693 times
1 Answers
3
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

Vigrond
- 8,148
- 4
- 28
- 46
-
Thanks for the suggestion - but I don't think this is valid in B4A? – Tony Moreira Dec 01 '11 at 17:21
-
It's not recognized in B4A - however B4A has something similar. – Tony Moreira Dec 01 '11 at 17:45
-
I apologize. Evidently Basic4Android has a separate function: SubString2 that takes 2 parameters. Just "SubString" takes 1 parameter (BeginIndex). Updated original answer – Vigrond Dec 01 '11 at 18:12
-
Combing this with Length to get the length of the varying files did the trick. TY. – Tony Moreira Dec 01 '11 at 20:50