string_dogoo

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

string dogoo

This is part of the dogoo package that provides Dart and Flutter utilities.
String Dogoo provides utility functions and extension for String.
Features #

Returns nullable boolean value from string value
Make string value to Titlecase.

Usage #
import 'package:string_dogoo/string_dogoo.dart';

void main() {
print("${stringToBool("true")}, ${stringToBool("true").runtimeType}"); // true, bool
print("${stringToBool("True")}, ${stringToBool("True").runtimeType}"); // true, bool
print("${stringToBool("truE")}, ${stringToBool("truE").runtimeType}"); // true, bool

print("${stringToBool("false")}, ${stringToBool("false").runtimeType}"); // false, bool
print("${stringToBool("False")}, ${stringToBool("False").runtimeType}"); // false, bool
print("${stringToBool("falsE")}, ${stringToBool("falsE").runtimeType}"); // false, bool

print(stringToBool("abcdef")); // null
print(stringToBool("")); // null

print(stringToTitleCase("apple")); // Apple
print(stringToTitleCase("banana")); // Banana

// * -------------------- *

print("${"true".toBool()}, ${"true".toBool().runtimeType}"); // true, bool
print("${"True".toBool()}, ${"True".toBool().runtimeType}"); // true, bool
print("${"truE".toBool()}, ${"truE".toBool().runtimeType}"); // true, bool

print("${"false".toBool()}, ${"false".toBool().runtimeType}"); // false, bool
print("${"False".toBool()}, ${"False".toBool().runtimeType}"); // false, bool
print("${"falsE".toBool()}, ${"falsE".toBool().runtimeType}"); // false, bool

print("abcdef".toBool()); // null
print("".toBool()); // null

print("apple".toTitleCase()); // Apple
print("banana".toTitleCase()); // Banana
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.