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
What is the equivalent to SQL Servers @@ROWCOUNT?
Cannot add event reminder in Outlook 2007 from linked Sharepoint 2003 calendar
Excel VBA Code Problem
Temporary Internet Files Move and delete
How to write an Excel if statement that would accomplish figuring the percentage of a dollar amount based on the scale below:
What table contains company/database name - MS Dynamics GP
VB.NET Solution
Need batch to move files older than 8 days
How to restrict the user to access only one Document Library other than accessing complete site?
Trying to understand Excel formula for sample size, sat confidence level and probability