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
Internet Drivers for IBM R51 Thinkpad
Forcing datasheet column headings onto 2 lines
Crystal reports integrated with MFC?
C drive is filling up with Live Update Downloads
SQL server and SQL agent will not start on both nodes in Active to Active SQL 2005 SP3 x64 Enterprise cluster on Windows 2008 x64 after applying KB958644
IEXPLORE.EXE VIRUS?
Permissions - Cant access Server from XP machine
Installing sample databases on Sql Server 2008
Hard question:Tab Control Pages;To many command buttons!!
How to filter a CurrentDb.OpenRecordset?