simple_string_utils 0.0.1
simple_string_utils: ^0.0.1 copied to clipboard
A simple package with useful extension methods for strings, like capitalize() and isEmail().
Simple String Utils #
A simple, zero-dependency package that adds essential and easy-to-use extension methods to the String class to simplify common text manipulation and validation tasks.
Features #
- ✅
capitalize(): Capitalizes the first letter of a string. - ✅
isEmail(): Checks if a string has a valid email format. - 🚀 Zero dependencies.
- 🎈 Lightweight and easy to use.
Getting Started #
In your pubspec.yaml file, add the dependency:
dependencies:
simple_string_utils: ^0.0.1 # Use the latest version from pub.dev
Then, run flutter pub get in your terminal.
Usage #
Import the package in the file where you want to use it:
import 'package:simple_string_utils/simple_string_utils.dart';
Now you can use the extension methods on any string variable!
capitalize() #
String greeting = 'hello world';
print(greeting.capitalize());
// Output: 'Hello world'
isEmail() #
String email1 = 'test@example.com';
String email2 = 'not-an-email';
print(email1.isEmail()); // Output: true
print(email2.isEmail()); // Output: false
Additional Information #
Feel free to file issues or suggest features on the GitHub repository's Issues tab.