I have lte problem on Console.WriteLine(). I have a while (true) loop that checks the data if it exists, and this will check the data 3 times. And inside my loop, I have this message:
Console.WriteLine (string.format ("Checking data {0}", ctr));
Here is my sample code below:
int ctr = 0;
while(true)
{
ctr += 1;
Console.WriteLine(string.format("Checking data {0}...",ctr))
if(File.Exist(fileName))
break;
if(ctr > 3)
break;
}
Assume no data was found.
My current output is as follows:
Checking data 1...
Checking data 2...
Checking data 3...
But the correct result that should have been achieved should look like this:
Checking data 1...2...3...
I would only show in one line.
Edit:
I forgot: in addition to my problem, I want to add "Not Found" and "Found".
Here's an example Output:
- 1... 2... 3... !