string_util 0.0.2 copy "string_util: ^0.0.2" to clipboard
string_util: ^0.0.2 copied to clipboard

discontinued

A new Flutter package string util with common regex use cases. removing whitespace, is valid url, valid email, alphanumeric and more.

example/README.md

String Util #

A new Flutter package string util with common regex use cases. removing whitespace, is valid url, valid email, alphanumeric and more.

The String Util defines certain words related to String handling.A pure dart package.

Usage #

uppercase

var newString = 'string need to transform uppercase'.upperCase
result:
STRING NEED TO TRANSFORM UPPERCASE.

capitalizeFirsWord

var newString = 'string need to transform'.capitalizeFirsWord
result:
 String need to transform

capitalizeFirsWordOfEach

var newString = 'string need to transform'.capitalizeFirsWordOfEach
result:
String Need To Transform

lowerCase

var newString = 'STRING NEED TO TRANSFORM LOWERCASE'.lowerCase
result:
string need to transform lowercase.

removeBlankSpace

var newString = '  Hello world   '.removeBlankSpace
result:
Hello world

isNumeric

var numeric =null.isNumeric            =>   false;
var numeric =''.isNumeric              =>   false;
var numeric ='a'.isNumeric             =>   false;
var numeric ='Ab'.isNumeric            =>   false;
var numeric ='ac0811'.isNumeric        =>   false;
var numeric ='0811aqs'.isNumeric       =>   false;
var numeric ='08'.isNumeric            =>   true;
var numeric ='-11'.isNumeric           =>   true;
var numeric ='08.11'.isNumeric         =>   true;

isAlphaNumeric

var alphaNumeric =null.isAlphaNumeric            =>   false;
var alphaNumeric =''.isAlphaNumeric              =>   false;
var alphaNumeric ='a'.isAlphaNumeric             =>   false;
var alphaNumeric ='Ab12'.isAlphaNumeric            =>   true;

containLowerCase

var has =null.containLowerCase            =>   false;
var has =''.containLowerCase              =>   false;
var has ='a'.containLowerCase             =>   true;
var has ='Ab12'.containLowerCase            =>   true;
var has ='AV'.containLowerCase            =>   false;

containUpperCase

var has =null.containUpperCase            =>   false;
var has =''.containUpperCase              =>   false;
var has ='a'.containUpperCase             =>   false;
var has ='Ab12'.containUpperCase            =>   true;
var has ='AV'.containUpperCase            =>   true;

isEmail

var email = 'deepak.com'.isEmail => false.
var email = 'someone@example.com'.isEmail => true.

isUrl

var url = 'example.com'.isUrl  => false;
var url = 'http://example.com'.isUrl  => true;
var url = 'https://example.com'.isUrl  => true;
var url = 'https://www.example.com'.isUrl  => true;
var url = 'www.example.com'.isUrl  => false;

isEqual(other)

var isEqual = null.isEqual('Example'); => false
var isEqual = ''.isEqual('Example'); => false
var isEqual = 'example'.isEqual('Example'); => false
var isEqual = 'example'.isEqual('example'); => true

isEqualIgnoreCase(other)

var isEqual = null.isEqualIgnoreCase('example'); =>false
var isEqual = ''.isEqualIgnoreCase('example'); =>false
var isEqual = 'example'.isEqualIgnoreCase('example'); =>true
var isEqual = 'example'.isEqualIgnoreCase('example'); =>true
var isEqual = 'example'.isEqualIgnoreCase('Example'); => true

countMatches(other)

var count = null.countMatches('example'); =>0
var count = ''.countMatches('example'); =>0
var count = 'This is example'.countMatches('example'); =>1
var count = 'This is example with two example'.countMatches('example'); =>2
var count = 'This is example with two Example'.countMatches('example'); =>1

countMatchesIgnoreCase(other)

var count = null.countMatchesIgnoreCase('example'); =>0
var count = ''.countMatchesIgnoreCase('example'); =>0
var count = 'This is example'.countMatchesIgnoreCase('example'); =>1
var count = 'This is example with two example'.countMatchesIgnoreCase('example'); =>2
var count = 'This is example with two Example'.countMatchesIgnoreCase('example'); =>2

initials

var data = null.initials; =>'';
var data = ''.initials; =>'';
var data = 'null'.initials; =>N;
var data = 'Deepak'.initials; =>D;
var data = 'Deepak Gupta'.initials; =>DG;
var data = 'deepak gupta'.initials; =>DG;

hasSpecialCharacters

var has =null.hasSpecialCharacters            =>   false;
var has =''.hasSpecialCharacters              =>   false;
var has ='a'.hasSpecialCharacters             =>   false;
var has ='Ab12'.hasSpecialCharacters          =>   false;
var has ='@deepak'.hasSpecialCharacters       =>   true;
var has ='#deepak'.hasSpecialCharacters       =>   true;
1
likes
90
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package string util with common regex use cases. removing whitespace, is valid url, valid email, alphanumeric and more.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on string_util