string_extensions 0.1.3 copy "string_extensions: ^0.1.3" to clipboard
string_extensions: ^0.1.3 copied to clipboard

outdated

Useful String extensions to save you time in production. Feel free to contribute with PR.

Feelm

Version


Current Methods #

  • readTime()
String foo =  'Hello dear friend how you doing ?';
int readTime = foo.readTime() // returns 3 seconds.
  • isMail()
String foo = 'esentis@esentis.com'
bool isMail = foo.isMail() // returns true
String foo = 'esentis@esentis'
bool isMail = foo.isMail() // returns false
  • onyLetters()
String foo = '4*%^55/es4e5523nt1is';
String letters = foo.onlyLetters() // returns 'esentis';
  • removeNumbers()
String foo = 'es4e5523nt1is';
String noNums = foo.removeNumbers() // returns 'esentis'
String foo = '1244e*s*4e*5523n*t*1i*s'
String noNums = foo.removeNumbers() // returns 'e*s*e*n*t*i*s'
  • countWords()
String foo = 'Hello dear friend how you doing ?';
int count = foo.countWords() // returns 7 words.
  • capitalize()
String foo = 'hAckErrR';
String cFoo = foo.capitalize(); // returns 'Hackerrr'.
  • toCamelCase()
String foo = 'Find max of array';
String camelCase = foo.toCamelCase() // returns 'findMaxOfArray'
  • onlyNumbers()
String foo = '4*%^55/es4e5523nt1is';
String onyNumbers = foo.onlyNumbers() // returns '455455231'
  • removeLetters()
String foo = 'es4e5523nt1is';
String noLetters = foo.removeLetters() // returns '455231'
String foo = '1244e*s*4e*5523n*t*1i*s'
String noLetters = foo.removeLetters() // returns '1244**4*5523**1*'
  • charOccurences()
String foo = 'esentis';
List occurences = foo.charOccurences() // returns '[{e:2},{i:1},{n:1},{s:2},]'
  • mostFrequent()
String foo = 'Hello World';
String mostFrequent = foo.mostFrequent() // returns 'l'
  • reverse()
String foo = 'Hello World';
String reversed = foo.reverse() ; // returns 'dlrow olleH'
  • isIpv4()
String foo = '192.168.1.14';
bool isIpv4 = foo.isIpv4(); // returns true
String foo = '192.168.1.14.150.1225';
bool isIpv4 = foo.isIpv4(); // returns false
  • toTitleCase()
String foo = 'hello world';
String fooTitled = foo.toTitleCase(); // returns 'Hello World'
  • first()
String foo = 'hello world';
String firstChars = foo.first(); // returns 'h'
  • last()
String foo = 'hello world';
String lastChars = foo.last(); // returns 'd'
  • toSlug()
String foo = 'hello world';
String fooSlug = foo.toSlug(); // returns 'hello_world'
  • replaceGreek()
 String foo = 'Αριστοτέλης';
 String fooReplaced = foo.replaceGreek(); // returns 'aristotelis'
  • findPatterns({required String pattern})
String foo = 'abracadabra';
String fooOccs = foo.findPattern(pattern:'abr'); // returns '[0, 7]'
  • toStringArray()
String foo = 'abracadabra';
List<String> fooArray = foo.toStringArray(); // returns '[a,b,r,a,c,a,d,a,b,r,a]'
  • stripHtml()
String html = '<script>Hacky hacky.</script> <p>Here is some text. <span class="bold">This is bold. </span></p>';
String stripped = foo.stripHtml(); // returns 'Hacky hacky. Here is some text. This is bold.'
28
likes
0
pub points
93%
popularity

Publisher

verified publisheresentis.dev

Useful String extensions to save you time in production. Feel free to contribute with PR.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on string_extensions