Click here to Skip to main content
13,002,169 members (83,064 online)

Regular Expressions

QuestionRename File Name Help Pin
toikken5-Aug-12 18:56
membertoikken5-Aug-12 18:56 
AnswerRe: Rename File Name Help Pin
Bernhard Hiller5-Aug-12 23:11
memberBernhard Hiller5-Aug-12 23:11 
You can use System.IO.Path.GetFileNameWithoutExtension(). Then find the position of the last "-" with the LastIndexOf('-') function of the string class. Build up your new string from the respective Substring()s.
GeneralRe: Rename File Name Help Pin
toikken6-Aug-12 15:05
membertoikken6-Aug-12 15:05 
GeneralRe: Rename File Name Help Pin
Bernhard Hiller6-Aug-12 20:24
memberBernhard Hiller6-Aug-12 20:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 8 May 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid