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
runtime error 6 overflow error - vba excel program
Fast loading items into DataGridView or similar control
UPDATE OPENQUERY (LINKEDSERVER, 'SELECT...) SET FIELD = #
Userenv 1054, DnsApi 11197 and Dhcp 1003 event viewer logs
advice on gas mileage query in a fleet management database
event id 1639 warning message on blackberry server
How do you count the number of folders in an Exchange 2007 mailbox?
SQL Insert Given Date Range
IEENCODE.DLL.000
specified field could refer to more than one table listed in the FROM clause of SQL statement