acronym 0.5.1 copy "acronym: ^0.5.1" to clipboard
acronym: ^0.5.1 copied to clipboard

A simple, lightweight and easy to use package to generate acronyms.

example/acronym_example.dart

// ignore_for_file: avoid_print

import 'package:acronym/acronym.dart';

void main() {
  const String input = "The United States of America";

  // Generate the acronym with the default Values
  final String output = generateAcronym(input);
  print(output); // "USA"

  const List<String> stopWords = ["the", "of", "states"];

  // Generate the acronym with the [stopWords] to exlude the words ["the", "of", "states"]
  final String output2 = generateAcronym(input, stopWords: stopWords);
  print(output2); // "UA"

  // Generate the acronym with the extension
  final String output3 = input.toAcronym();
  print(output3); // "USA"

  // Generate the acronym with the extension using the [stopWords] to exlude the words ["the", "of", "states"]
  final String output4 = input.toAcronym(stopWords: stopWords);
  print(output4); // "UA"

  // Generate the acronym using the [splitSyllables] flag
  final String output5 = input.toAcronym(splitSyllables: true);
  print(output5); // UtStArc
}
20
likes
160
pub points
64%
popularity

Publisher

verified publisherjxstxn.dev

A simple, lightweight and easy to use package to generate acronyms.

Homepage
Repository (GitHub)
View/report issues

Topics

#acronym

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

recase

More

Packages that depend on acronym