patsubst 0.0.9

  • README.md
  • Example
  • Installing
  • Versions
  • --

patsubst #

Pattern based text substitution in strings.

Examples:

import "package:patsubst/patsubst.dart";

void main() {
  var subst = patsubst("foo/%/%1.cc", "wow/%/with/kara_%2.obj");
  var source = "foo/bar/baz1.cc";
  var result = subst.replace(source);
  print("$source => $result");  
}

Output:


example/example.dart

import "package:patsubst/patsubst.dart";

void main() {
  var subst = patsubst("foo/%/%1.cc", "wow/%/with/kara_%2.obj");
  var source = "foo/bar/baz1.cc";
  var result = subst.replace(source);
  print("$source => $result");
  // foo/bar/baz1.cc => wow/bar/with/kara_baz2.obj
}

Use this package as a library

1. Depend on it

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


dependencies:
  patsubst: ^0.0.9

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:patsubst/patsubst.dart';
  
Version Uploaded Documentation Archive
0.1.0 Aug 13, 2018 Go to the documentation of patsubst 0.1.0 Download patsubst 0.1.0 archive
0.0.9 Jul 28, 2014 Go to the documentation of patsubst 0.0.9 Download patsubst 0.0.9 archive
Awaiting analysis to complete.