How to Trim occurrence of all Characters from a Text

Written by omerkamal on Mar 26, 2007
Trimming many Character at the same time in .NET 3.0

Explanation:

public string RemoveChars(string Txt)
{
char[] chars = new char[] { '@', '+', '*' };
int index = 0;
foreach (char ch in chars)
{
index = 0;
while (Txt.Contains(ch.ToString()))
{
index = Txt.IndexOf(ch);
Txt = Txt.Remove(index,1);
}
}
return Txt;
}
Visitors/Readers Comments
(for questions please use The Forum)



"Be the First to Comment!"


Add your Comments

Name:  
Message:


Advertise Here
For more details
Contact Us

Advertisments