E
Erik Eckhardt
I am trying to create a class or function which does one extra thing then
performs a normal Console.WriteLine, preferrably with all the overloads
available and intact.
Where I currently have:
Console.Write("\r
\r");
// note, the previous line is simply clearing any text on the current
console line without leaving that lnie.
Console.WriteLine("{0} {1} {2} {3} ({4})", new object[] {var1, var2, var3,
var4, var5});
I'd like to do
MyClass.OverwriteLine("{0} {1} {2} {3} ({4})", new object[] {var1, var2,
var3, var4, var5});
and get the same result, with all WriteLine overloads available for
OverwriteLine, and hopefully without having to duplicate them all.
Can anyone help me out with this?
I asked some friends and one idea was the following, and it is better than
the extra Console.Write each time, but I am still hoping for more:
static string SomeMethod(string toPad)
{
return "\r
\r" + toPad;
}
Console.WriteLine(SomeMethod("here is a string {0} : {1}"), new
object[]{"some", 5});
I'm using Framework 2.0.
Erik
performs a normal Console.WriteLine, preferrably with all the overloads
available and intact.
Where I currently have:
Console.Write("\r
\r");
// note, the previous line is simply clearing any text on the current
console line without leaving that lnie.
Console.WriteLine("{0} {1} {2} {3} ({4})", new object[] {var1, var2, var3,
var4, var5});
I'd like to do
MyClass.OverwriteLine("{0} {1} {2} {3} ({4})", new object[] {var1, var2,
var3, var4, var5});
and get the same result, with all WriteLine overloads available for
OverwriteLine, and hopefully without having to duplicate them all.
Can anyone help me out with this?
I asked some friends and one idea was the following, and it is better than
the extra Console.Write each time, but I am still hoping for more:
static string SomeMethod(string toPad)
{
return "\r
\r" + toPad;
}
Console.WriteLine(SomeMethod("here is a string {0} : {1}"), new
object[]{"some", 5});
I'm using Framework 2.0.
Erik