String replace

JimmyFo

Member
Joined
Aug 15, 2005
Messages
13
Programming Experience
1-3
Hi, I am looking to to some string manipulation. I need to replace the last, and only last "." in a filename with "_thumb."

String function "Replace" replaces all of them - is there a way to replace just the rightmost period?

Thanks,
James
 
You could use String.LastIndexOf method in combination with String.Substring method.
You could also do it with help of System.IO.Path.GetFileNameWithoutExtension and IO.Path.GetExtension methods.
 
Back
Top