stringprocess 1.0.10

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

stringprocess #

A string library for common string operations and general text helper functions.

Usage #

A simple usage example:

import 'package:stringprocess/stringprocess.dart';

main() {
  // A few simple examples.
  StringProcessor tps = new StringProcessor();

  // Print the numbers 1 to 10.
  print(tps.getSequenceString(1, 10, 1));

  // Repeat Something!
  print(tps.getRepeatedString("Mine!", 42));

  // Word count.
  print(tps.getWordCount("Dart is Awesome and cool!"));

  // Line count.
  print(tps.getLineCount("hello\ngood\nevening\nwelcome!\n"));
}

Unit Testing #

  • pub run test

Check source code formatting: #

  • dartfmt -n .

Acknowledgements #

This package makes use of the following Dart packages:

  • html_unescape
  • markdown

Features and bugs #

Please file feature requests and bugs!

Changelog #

1.0.10 #

  • Refresh and dependencies updated.

1.0.9 #

  • Fixes to line duplication and UTs.
  • Refactor to use more type inference.

1.0.8 #

  • Update for Dart 2.

1.0.7 #

  • Improve Duplicate line by index when next to new line.

1.0.6 #

  • Further sentence count improvements.
  • New function - convert tabs to spaces.

1.0.5 #

  • Improve sentence count by ignore sentences that are numbers only.
  • New function - Remove numbers from a string.
  • New function - Duplicate line by index.

1.0.4 #

  • Count sentences in the text supplied.

1.0.3 #

  • Sort lines in string by length (ascending).

1.0.2 #

  • Splice function covers cases where splice values are outside string length.

1.0.1 #

  • Splice changes.
  • Refactor line splitting.

1.0.0 #

  • Bump to version 1 as package is stable.
  • Added splice method to chop characters off start/end of a line.

0.0.9 #

  • trimAllSpaces function added.

0.0.8 #

  • Minor doc updated and SDK constraint changed.

0.0.7 #

  • Added simple numbering method.

0.0.6 #

  • Improved split method

0.0.5 #

  • Added split method

0.0.4 #

  • Added deleteLinesNotContaining method

0.0.3 #

  • Update to prepare for Dart 2.0.

0.0.2 #

  • Documentation added.
  • Minor refactoring and renaming.

0.0.1 #

  • Initial version extracted from NP8080.

example/stringprocess_example.dart

// Copyright (c) 2017-2019, daftspaniel. 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:stringprocess/stringprocess.dart';

main() {
  // A few simple examples.
  var tps = new StringProcessor();

  // Print the numbers 1 to 10.
  print(tps.generateSequenceString(1, 10, 1));

  // Repeat Something!
  print(tps.generateRepeatedString("Mine!", 42));

  // Word count.
  print(tps.getWordCount("Dart is Awesome and cool!"));

  // Line count.
  print(tps.getLineCount("hello\ngood\nevening\nwelcome!\n"));
}

Use this package as a library

1. Depend on it

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


dependencies:
  stringprocess: ^1.0.10

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:stringprocess/stringprocess.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
61
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:stringprocess/stringprocess.dart.

Health suggestions

Fix lib/src/stringprocess_base.dart. (-9.99 points)

Analysis of lib/src/stringprocess_base.dart reported 21 hints, including:

line 45 col 33: Use isEmpty instead of length

line 177 col 11: Use isNotEmpty instead of length

line 179 col 42: Use contains instead of indexOf

line 190 col 12: Use contains instead of indexOf

line 209 col 11: Use isNotEmpty instead of length

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
html_unescape ^1.0.1 1.0.1+3
markdown ^2.0.2 2.1.1
Transitive dependencies
args 1.5.2
charcode 1.1.2
Dev dependencies
test ^1.3.0