common_utilities 0.0.4 copy "common_utilities: ^0.0.4" to clipboard
common_utilities: ^0.0.4 copied to clipboard

outdated

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.4 Includes only String utils.

String Utils #

Includes over 30 useful string functions such as :

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