Click here to Skip to main content
12,444,790 members (55,431 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.160811.3 | Last Updated 26 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid