"jcooper" wrote:
Take a look at the String.Trim method. That should help you out.
http://msdn.microsoft.com/library/de...strimtopic.asp
Never thought to use trim. I guess this would work. Once I find one instance
of the trim result being empty I can exit, since I know I have an error.
Thanks.
public void trimstring()
{
String str1 = "*;|@123***456@|;*";
String delim = "*";
String str2; //= str1.Trim(delim.ToCharArray());
Console.WriteLine("Delimiters: {0}", delim);
Console.WriteLine("Original string: {0}", str1);
for( int i = 0; i < str1.Length; i++)
{
str2 = str1[i].ToString().Trim(delim.ToCharArray());
if (str2 =="")
Console.WriteLine("Trimmed string: Empty");
Console.WriteLine("Trimmed string: {0}", str2);
}
}