Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
lib
test
README.md

README.md

Str

Str is a library dedicated to generic String methods.

Here's a sample:

import "../lib/str.dart";
import "../../lang/lib/lang.dart";


main() {
  var sample = "first\nsecond\nthird", i = Str.indexOfNewLine(sample),
    lineCount = 1;
  while (i >= 0) {
    lineCount++;
    i = Str.indexOfNewLine(sample, i + 1);
  }
  p("Line count: ${lineCount}");
}

indexOfNewLine is a speedier newline matcher on the Dart VM. The original idea was by Alex Tatumizer of the Dart misc group.

Something went wrong with that request. Please try again.