valueOfString static method
Returns an Integer instance from a string.
str the string representation
radix the radix to use for parsing (default is 10)
A wrapper class for int that provides Java-like functionality and methods.
This class wraps Dart's primitive int type and provides additional utility methods similar to Java's Integer class, making it easier for Java developers to work with integers in Dart.
Example usage:
Integer a = Integer(42);
Integer b = Integer.valueOf(10);
Integer c = Integer.parseInt("123");
print(a.toString()); // "42"
print(a.compareTo(b)); // 1 (since 42 > 10)
print(Integer.max(a.value, b.value)); // 42
Implementation
static Integer valueOfString(String str, [int radix = 10]) {
return parseInt(str, radix);
}