tehon3299 Posted March 13, 2003 Posted March 13, 2003 (edited) How can I see what the first character of a string is? I am getting a filename via: Path_ = "C:\Inetpub\wwwroot\SongShare\Songs\" Dim sFiles() As String = System.IO.Directory.GetFiles(Path_) Dim sFile As String sFile = System.IO.Path.GetFileName(sFile) How can I look at only the first character of the filename in sFile? Thanks Edited March 13, 2003 by tehon3299 Quote Thanks, Tehon
*Experts* Nerseus Posted March 13, 2003 *Experts* Posted March 13, 2003 You can use the SubString method, as in: sFile.SubString(0, 1) -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
tehon3299 Posted March 13, 2003 Author Posted March 13, 2003 OK...That works great but it doesn't read the character for the first filename and all the files after that are like 1 behind. I.E. Apple is nothing Ace is A Banana is A Cat is B What's going on? Quote Thanks, Tehon
*Experts* Volte Posted March 13, 2003 *Experts* Posted March 13, 2003 Remember that arrays are 0 based, so you need to start whatever loop you're using at 0, not 1. Post some code so we can see. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.