Last updated:
0 purchases
lazy string
lazy_string #
This package can help people who are lazier and beginner to the faster when they use String and make a lot of function.
Usage #
camelize(String text) => String #
Converts underscored or dasherized String to a camelized one. Begins with a lower case letter unless it starts with an underscore, dash or an upper case letter.
LazyString.camelize('lazy-string');
// => "lazyString"
LazyString.camelize('-lazy-string');
// => "LazyString"
LazyString.camelize('_lazy_string');
// => "LazyString"
LazyString.camelize('Lazy_string');
// => "LazyString"
copied to clipboard
underscored(String text) => String #
Converts a camelized or dasherized String into an underscored one.
LazyString.underscored('LazyString');
// => "lazy_string"
copied to clipboard
dasherize(String text) => String #
Converts a underscored or camelized String into an dasherized one.
LazyString.dasherize('LazyString');
// => "-lazy-string"
copied to clipboard
humanize(String text) => String #
Converts an underscored, camelized, or dasherized String into a humanized one. Also removes beginning and ending whitespace, and removes the postfix '_id'.
LazyString.humanize(' capitalize dash-CamelCase_underscore trim ');
// => "Capitalize dash camel case underscore trim"
copied to clipboard
words(String text, {String delimiter}) => List<String> #
Split string by delimiter (String or Pattern), /\s+/ by default.
LazyString.words(" lazy string ");
// => ["lazy", "string"]
LazyString.words("lazy_string", delimiter: "_");
// => ["lazy", "string"]
LazyString.words(" ")
// => []
copied to clipboard
chars(String text) => List<String> #
LazyString.chars('lazystring');
// => ["l", "a", "z", "y", "s", "t", "r", "i", "n", "g"]
copied to clipboard
repeat(String text, {int count, String separator}) => String #
Repeats a string count times.
LazyString.repeat("lazy", count: 3);
// => "lazylazylazy"
LazyString.repeat('lazy', count: 2, separator: 'string');
// => "lazystringlazy"
copied to clipboard
count(String text, String char) => int #
Returns int of occurrences of char in String.
LazyString.count("Hello world", "l");
// => 3
copied to clipboard
reverse(String text) => String #
Return reversed string.
LazyString.reverse('Music 𝄞 make happy');
// => "yppah ekam 𝄞 cisuM"
copied to clipboard
clean(String text) => String #
Trim and replace multiple spaces with a single space.
LazyString.clean(' lazy string ');
// => "lazy string"
copied to clipboard
classify(String text) => String #
Converts string to camelized class name. First letter is always upper case
LazyString.classify('lazy_string');
// => "LazyString"
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.