basically i have a status bar thats displaying strings via the number of files im process.
Ex
Files Process: 1. HelloWorld.txt ( 1 of 5)
I want to strip out the "1." for my status bar, how would you do that, You can't do it with the remove or replace function
the output should be like this below. so basically im using the line in red above for something else but without the (1 of 5) i simply want to take away the counter thats after the ":"
Files Process: HelloWorld.txt ( 1 of 5)
Loading
David SmithPosted Nov 24, 2010, 5:41 AM
ShankeyPosted Nov 24, 2010, 2:00 AM
David SmithPosted Nov 24, 2010, 1:26 AM
String[] arrTxt = message.Split(':');
String[] arrTxt1 = arrTxt[1].Split('.');
String strMsg = arrTxt[0] + ": " + arrTxt1[1] + "."+ arrTxt1[2];
David SmithPosted Nov 23, 2010, 7:06 PM
ShankeyPosted Nov 23, 2010, 8:04 AM
Try following code, it will help you to some extent
String txt = "Files Process: 1. HelloWorld.txt ( 1 of 5)";
String[] arrTxt = txt.Split(':');
String[] arrTxt1 = arrTxt[1].Split('.');
String str = arrTxt[0] + ": ";
for (int i = 1; i < arrTxt1.Length; i++)
{
str = str + arrTxt1[i].Trim() + ".";
}
str = str.Trim('.');
Console.WriteLine(str);