common_utilities 0.0.5

Flutter Android iOS web

A Dart Common Utility Package .

common_utilities #

A Dart Common Utility Package . That contain useful functions for different classes.

Includes a set of String , Int , List functions and so on. that make your work much faster and easier.

version 0.0.5 Includes only String utils.

String Utils #

Includes over 30 useful string functions such as :

  1. subStringBetween
  2. subStringsBetween
  3. subStringAfter
  4. subStringBefore
  5. insertAt
  6. removeAt
  7. insertAfter
  8. insertAfterEvery
  9. removeAfter
  10. removeBefore
  11. isNumericInt
  12. isNumericDouble
  13. isAlphabetic
  14. isUpperCase
  15. isAlphaNumeric
  16. isBlank
  17. isContainSpecialChar
  18. isValidCharacters
  19. convertEnglishNumberToPersian
  20. convertPersianNumberToEnglish
  21. convertToMoneyFormat
  22. countWords
  23. countLines
  24. reverse
  25. reverseWords
  26. removeBlankLines
  27. removeLinesThatContain
  28. isEmail
  29. convertToBase64
  30. convertBase64ToString
  31. convertToUTF8

How To Use #

Example for StringUtils : #

import 'package:common_utilities/common_utilities.dart';

void main() {
  
  String mainStr = 'If you want something you have never had you must do something you have never done';

  String result  = mainStr.StringUtils().subStringBetween('want', 'never');
  // prints =>  'something you have'

  List<String> result2  = mainStr.StringUtils().subStringsBetween('you', 'never');
  // prints =>  ['something you have' , 'must do something you have']

  
  String result3  = mainStr.StringUtils().subStringAfter('something');
  // prints =>  'you have never had you must do something you have never done'

  bool lastIndex = true; //This is optional & its false by default
  String result4  = mainStr.StringUtils().subStringAfter('something',lastIndex);
  // prints =>  'you have never done'
  
}

Changelog #

Refer to the Changelog to get all release notes.