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
Set an incrementing Sequence number.
SQL Server 2008 Standard Edition
IIS: How to define multiple web sites, each with their own domain and SSL?
Verifying DMI Pool Data& A disk read error occurred Press Ctrl+Alt+Del to restart
Query
Looking for a bootable CD that will allow advanced Windows recover and repair options to be run, such as using System Restore to restore the system to a prior date
SharePoint List: How to add google maps location
Excel VBA email - Outlook dialog box pop asking permission
Enter data in a MSFlexgrid control
Windows 7 Printer Driver Issues With HP LJ 1320 Series