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
Error opening excel files: "Windows cannot find 'C:\Users\Ryan\Desktop\xxx<wbr />xexcel file namexxx'.
WSUS Running
Load analysis services data into an Access table
Send/receive fax via ms access
OWA 2007 Password Change Working with ISA 2006 When it Should Not.
Auto populating fields
USB device in VMware
Improving as a Programmer
TabletServicePen error on Fujitsu tablet pc
DoCmd.TransferSpreadsheet acImport and Excel field size >255