Jump to content
Xtreme .Net Talk

Recommended Posts

Guest lepernet
Posted

I was sure that I saw a function for extracting the extension from a filename. Alas having pulled all my hair out trying to find it in the documentation I now throw myself on your mercy.

 

Ok ... what is it ?

:(

Guest UncleSam
Posted

position = InStrRev(Text1.Text, ".")
Text2.Text = Right(Text1.Text, Len(Text1.Text) -  position + 1)

 

I'm nearly sure it works like this. It even works if you have 10000 + . in the filename

  • *Experts*
Posted

Divil is right. If you want to use the cool new .NET framework

methods and classes, go for using the IO.Path class. It's also

much easier than the above.

 

The method to use is IO.Path.GetExtension()

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...