Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: VB7
Expertise: beginner
Jun 8, 2002



Application Security Testing: An Integral Part of DevOps

ChangeFileExtension - Modify the extension in a file name

' Change the extension of a file name
' if the last argument is True, it adds the extension even if the file doesn't 
' have one

Function ChangeFileExtension(ByVal FileName As String, _
    ByVal Extension As String, Optional ByVal AddIfMissing As Boolean = False) _
    As String
    If AddIfMissing OrElse IO.Path.GetExtension(FileName).Length > 0 Then
        Return IO.Path.ChangeExtension(FileName, Extension)
        Return FileName
    End If
End Function
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date