Logo

Programming-Idioms

  • C++
  • Java
  • Dart
  • Obj-c
@import Foundation;
NSString *s=@(i).description;

@(...) converts a plain-C value to its object representation; the description message converts any object to its string representation.
#include <string>
auto s = std::to_string(i);
String s = "";
while (i != 0) {
    s = i % 10 + s;
    i = i / 10;
}
String s=((Integer)i).toString();
String s = String.valueOf(i);

This is a static method.
String s = Integer.toString(i);

This is a static method, no need to create an Integer instance.
String s = "%d".formatted(i);
String s = "" + i;
var s = "$i";
S : String := Integer'Image (I);

New implementation...