Implement a function which convert the given boolean value into its string representation.
예:
import "package:test/test.dart"; import "package:solution/solution.dart";
void main() { group("Fixed tests", () { test("Testing for true", () => expect(booleanToString(true), equals("true"))); test("Testing for false", () => expect(booleanToString(false), equals("false"))); }); }
내답:
String booleanToString(bool b) => b.toString();
String booleanToString(bool b) => "$b".contains("true") ? "true" : "false";
String booleanToString(bool b) => b.toString();
String booleanToString(bool b) => b ? "true" : "false";