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
Need Help.. couldn't find my problem
Concatenate or merger in MS Access query
Select multiple Access records question.
Need help understanding Enforced Group Policy link Option
GPO for desktop icons in Windows Server 2008 R2
Obtaining all licensing details including product keys for many servers?
WSUS for IT outsoursing clients (one WSUS for few companies)
SQL Query, Union All Question
prevent user to save worksheet
How to terminate a processes in MS SQL Server