cstring 1.0.0-dev

  • README.md
  • Installing
  • Versions
  • 31


Native bindings for a few <cstring> functions, also includes char support.


  cstring: ^1.0.0-dev



import "package:cstring/cstring.dart";

main() {
  var greeting = new Cstring("Hello, world!");

  // strncmp
  bool saysHi = greeting.compareN(new Cstring("Hello"), 5) == 0;

  // strcmp
  print(saysHi = "foo");

  // Also static
  print(Cstring.strncmp("A", "B", 1));


import "package:cstring/cstring.dart";

class SomeLexer {
  List<Token> tokens = [];

  void scan(String text) {
    // Automatically takes first char of string
    Char ch = new Char(text);

    // isdigit, isalnum, isalpha
    if (ch.isDigit())
      tokens.add(new Token("NUMBER", ch.value));

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  cstring: "^1.0.0-dev"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:cstring/cstring.dart';
Version Uploaded Documentation Archive
1.0.0-dev Sep 1, 2016 Go to the documentation of cstring 1.0.0-dev Download cstring 1.0.0-dev archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
93 / 100
Reflects how tidy and up-to-date the package is. [more]
16 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: other

Primary library: package:cstring/cstring.dart with components: nativewrappers.


  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Package is getting outdated.

    The package was released 93 weeks ago.

  • Package is pre-release.

    Pre-release versions should be used with caution, their API may change in breaking ways.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use cstring.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Run dartfmt to format lib/cstring.dart.


Package Constraint Resolved Available
Dev dependencies
test >=0.12.15+6 <0.13.0