more_functions 0.0.2 more_functions: ^0.0.2 copied to clipboard
A dart package which provides a lot of helpers functions for easy development.
more_functions #
A dart package which provides a lot of helpers functions for easy development.
Installation #
- Add this to your packages pubspec.yaml file:
dependencies:
more_functions: <^last-version>
- Install it You could run pub get:
$ dart pub get
- Import it Now in Dart code, you can use:
import 'package:more_functions/more_functions.dart';
Overview #
List of Helpers type:
String #
CASE #
Case Assertions
//entire string
print('Dart is awesome!'.isUpperCase); // false
print('Dart is awesome!'.isLowerCase); // false
//characters
print('Dart is awesome!'.firstCharIsUpperCase); // true
print('Dart is awesome!'firstCharIsLowerCase); // false
print('Dart is awesome!'.lastCharIsUpperCase); // false
print('Dart is awesome!'.lastCharIsLowerCase); // true
print('Dart is awesome!'.charAtIsUpperCase(1)); // ['a'] false
print('Dart is awesome!'.charAtIsLowerCase(1)); // ['a'] true
//words
print('Dart is awesome!'.firstWordIsUpperCase); // false
print('Dart is awesome!'firstWordIsLowerCase); // false
print('Dart is awesome!'.lastWordIsUpperCase); // false
print('Dart is awesome!'.lastWordIsLowerCase); // true
print('Dart is awesome!'.wordAtIsUpperCase(1)); // ['is'] false
print('Dart is awesome!'.wordAtIsLowerCase(1)); // ['is'] true
Upper Case
print('dart'.firstCharToUpperCase()); // 'Dart'
print('dart'.firstCharToLowerCase()); // 'darT'
print('upper camel case'.toUpperCamelCase()); // 'Upper Camel Case'
print('upper underscore case'.toUpperSnakeCase()); // 'UPPER_UNDERSCORE_CASE'
print('upper kebab case'.toUpperKebabCase()); // 'UPPER-KEBAB-CASE'
Lower Case
print('DART'.firstCharToLowerCase()); // 'dART'
print('DART'.firstCharToLowerCase()); // 'DARt'
print('LOWER CAMEL CASE'.toLowerCamelCase()); // 'lower Camel Case'
print('LOWER SNAKE CASE'.toLowerSnakeCase()); // 'lower_underscore_case'
print('LOWER KEBAB CASE'.toLowerKebabCase()); // 'lower-kebab-case'
Char #
Char Assertions
print('Dart is awesome!'.hasChars); // true
print('Dart is awesome!'.hasOnlyChars); // false
print('Dart is awesome!'.hasOnlyUpperChars); // false
print('Dart is awesome!'.hasOnlyLowerChars); // false
Char Getters
print('dart'.firstChar); // returns 'd'
print('dart'.lastChar); // returns 't'
print('dart'.charAt(1)); // returns 'a'
Char Position
print('dart'.lastCharIndex); // returns 3
print('dart'.indexOfChar('a')); // returns 1
Char Transformation
print('dart'.toChars()); // returns ['d','a','r','t']
Word #
Word Getters
print('Dart is awesome!'.firstWord); // 'Dart'
print('Dart is awesome!'.lastWord); // 'awesome!'
print('Dart is awesome!'.wordAt(1)); // 'is'
Word Position
print('Dart is awesome!'.indexOfWord('Dart')); // returns 0
Word Transformation
print('Dart is awesome!'.toWords()); // ['Dart','is','awesome!']
Generic Utils #
Counters
print('Dart is awesome!'.countChar()); // 16
print('Dart is awesome!'.countWord()); // 3
Symbol
Add Symbol
Not implemented yet.
Remove Symbol
print('Dart Is Awesome!'.removeAllSymbols); // 'Dart Is Awesome'
Assertion Symbol
print('Dart is awesome!'.hasSymbols); // true
print('Dart is awesome!'.hasOnlySymbols); // false
Whitespace
Add Whitespace
Not implemented yet.
Remove Whitespace
print('Dart Is Awesome!'.removeAllWhitespaces); // 'DartIsAwesome!'
Assertion Whitespace
print('Dart is awesome!'.hasWhitespaces); // true
print('Dart is awesome!'.hasOnlyWhitespaces); // false