string_width 0.1.5 copy "string_width: ^0.1.5" to clipboard
string_width: ^0.1.5 copied to clipboard

Get the visual width of a string - the number of columns required to display it

example/string_width_example.dart

import 'package:string_width/string_width.dart';

void main() {
  print(stringWidth('a'));
  //=> 1

  print(stringWidth('叀'));
  //=> 2

  print(stringWidth('\u001B[1m叀\u001B[22m'));
  //=> 2
}
0
likes
160
pub points
62%
popularity

Publisher

unverified uploader

Get the visual width of a string - the number of columns required to display it

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

ansi_strip, characters, east_asian_width, emoji_regex

More

Packages that depend on string_width