turkish 0.2.1 copy "turkish: ^0.2.1" to clipboard
turkish: ^0.2.1 copied to clipboard

Turkish String upper-lower case converter and comparators for sorting

example/example.dart

import 'package:turkish/turkish.dart';

main() {
  // upperCase
  var inputL = "kısa şiir";
  print("UpperCase for [$inputL]");
  print("Default = ${inputL.toUpperCase()}, "
      "Turkish = ${turkish.toUpperCase(inputL)}\n");

  // lowerCase
  var inputU = "KISA ŞİİR";
  print("LowerCase for [$inputU]");
  print("Default = ${inputU.toLowerCase()}, "
      "Turkish = ${turkish.toLowerCase(inputU)}\n");

  // compareToTr
  var zonguldak = "Zonguldak";
  var cankiri = "Çankırı";
  print("Comparison for [$zonguldak] and [$cankiri]");
  print("Default = ${zonguldak.compareTo(cankiri)}, "
      "Turkish = ${zonguldak.compareToTr(cankiri)}\n");

  // sort Default
  var list = ["Az", "ağ", "aç", "ad"];
  print("Input = $list");
  print("Default Sort = ${list..sort()}");

  // sort Turkish
  list = ["Az", "ağ", "aç", "ad"];
  print("Turkish Sort = ${list..sort(turkish.comparator)}");

  // sort Turkish ignore case
  list = ["Az", "ağ", "aç", "ad"];
  print("Turkish Sort Ignore Case = "
      "${list..sort(turkish.comparatorIgnoreCase)}");
}
53
likes
150
points
1.31k
downloads

Publisher

unverified uploader

Weekly Downloads

Turkish String upper-lower case converter and comparators for sorting

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on turkish