Microsoft
Software
Hardware
Network
Question : Remove special character from string
using C# I have a string which is a filename of a file being uploaded. on some systems a period can be used as part of a filename like ".testfile.pdf" I need to remove the period only if it is the first character in the string. I have tried replace but all periods are removed and i haven't been able to tuse regex either.
Answer : Remove special character from string
you can use TrimStart from string to do that:
http://msdn.microsoft.com/
fr-fr/libr
ary/
system
.string.tr
imstart.as
px
for example:
string cleanFileName = ".testfile.txt".TrimStart(
'.');
Random Solutions
SSIS Dynamic Connection in Execute Sql Task
Scan folders and files for rights
Filtering data in a subform.
How to get the calendar date based on a weekday
SelectedValue which is invalid because it does not exist in the list of items
Excel marco (digital to character )
Import data from text file to ms access table?
ASP.NET,Javascript,Ajax: How to get a string from window.showModalDialog
Trying to open Outlook 2000 PST in Outlook 2003
uggestions for database structure for a program which allows user to add custom fields