Last updated:
0 purchases
acronym
A simple, lightweight and easy to use package to generate acronyms.
Usage #
You can use it with the standard arguments to generate your acronym:
import 'package:acronym/acronym.dart';
const String input = "The United States of America";
final String output = generateAcronym(input);
print(output); // "USA"
copied to clipboard
Sample usage with the extension:
import 'package:acronym/acronym.dart';
const String input = "The United States of America";
final String output = input.toAcronym();
print(output); // "USA"
copied to clipboard
You can use it with stop words like this:
import 'package:acronym/acronym.dart';
const String input = "The United States of America";
final String output = input.toAcronym(stopWords: stopWords);
final String output1 = generateAcronym(input, stopWords: stopWords);
print(output); // "USA"
print(output1); // "USA"
copied to clipboard
Add your own stop words:
import 'package:acronym/acronym.dart';
const String input = "The United States of America";
final List<String> stopWords = [...stopWords, "states"];
final String output = input.toAcronym(stopWords: stopWords);
print(output); //UA
copied to clipboard
If you want to generate the Acronym without any words you can do it like this
import 'package:acronym/acronym.dart';
const String input = "The United States of America";
final String output = input.toAcronym(stopWords: []);
print(output); //TUSOA
copied to clipboard
If you want to generate the acronym out of its syllables just add the splitSyllables Flag
import 'package:acronym/acronym.dart';
const String input = "The United States of America";
final String output5 = input.toAcronym(splitSyllables: true);
print(output5); // UtStArc
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.