GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Searching for packages
  • Package scoring and pub points
  • Using packages
  • Developing packages and plugins
  • Publishing a package
  • Using packages

This view

  • Original page
  • New address

GeezerVison is showing pub.dev β€” characters example | Dart package

characters 1.4.1 copy "characters: ^1.4.1" to clipboard
characters: ^1.4.1 copied to clipboard

Published 16 months ago β€’ verified publisherdart.dev
SDKDartFlutter
PlatformAndroidiOSLinuxmacOSwebWindows
507
β†’

Metadata

String replacement with operations that are Unicode/grapheme cluster aware.

More...

  • Readme
  • Changelog
  • Example
  • Installing
  • Versions
  • Scores

example/main.dart

// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:characters/characters.dart';

// Small API examples. For full API docs see:
// https://pub.dev/documentation/characters/latest/characters/characters-library.html
void main() {
  var hi = 'Hi πŸ‡©πŸ‡°';
  print('String is "$hi"\n');

  // Length.
  print('String.length: ${hi.length}');
  print('Characters.length: ${hi.characters.length}\n');

  // Last character.
  print('The string ends with: ${hi.substring(hi.length - 1)}');
  print('The last character: ${hi.characters.last}\n');

  // Skip last character.
  print('Substring -1: "${hi.substring(0, hi.length - 1)}"');
  print('Skipping last character: "${hi.characters.skipLast(1)}"\n');

  // Replace characters.
  var newHi = hi.characters.replaceAll('πŸ‡©πŸ‡°'.characters, 'πŸ‡ΊπŸ‡Έ'.characters);
  print('Change flag: "$newHi"');
}
507
likes
160
points
11.6M
downloads

Documentation

API reference

Publisher

verified publisherdart.dev

Weekly Downloads

Metadata

String replacement with operations that are Unicode/grapheme cluster aware.

Repository (GitHub)
View/report issues
Contributing

Topics

#strings #unicode

License

BSD-3-Clause (license)

More

Packages that depend on characters

← Metadata

507
likes
160
points
11.6M
downloads

Documentation

API reference

Publisher

verified publisherdart.dev

Weekly Downloads

Metadata

String replacement with operations that are Unicode/grapheme cluster aware.

Repository (GitHub)
View/report issues
Contributing

Topics

#strings #unicode

License

BSD-3-Clause (license)

More

Packages that depend on characters

Back

You are visitor 01402503 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.