Universel toString

Qian Xu quian.xu at stud.tu-ilmenau.de
Fri Mar 20 09:03:20 PDT 2009


The problem has been solved.

There is a wonderfull function in Tango.

--------------------------------------------
import tango.text.convert.Format;

class Foo {
  // attributes go here...
  public char[] toString() {
    return Format.convert(".... {} .. {} ..", attr1, attr2, attr3);
  }
}
--------------------------------------------

This works perfect with all data types.



More information about the Digitalmars-d-learn mailing list