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
Remove leading zeros
C#: Embedded files
sql
Access 2003 the default printer become the fax,when my command button called fax is clicked?
Excel dates going into ms Access as number
Sorting by Activity Date in Ascending Order
New Button Disabled on Form
VBA Code for Indirect Back End Synchronization Over VPN?
How do I capture output from command prompt in vb.net?
Working with vjslib.dll