パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v4.2.0

strings

null許容文字列を安全に扱うための拡張機能として、Stringクラスを拡張することを目的とした大規模な文字列関数のコレクション。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
15.7万
いいね数
58
Pub ポイント
160

パッケージをインストール

flutter pub add strings

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

strings パッケージは、Dart の String クラスを拡張する包括的なユーティリティ関数のセットを提供し、null でない文字列と null 可能な文字列の両方を扱うためのより安全で便利なメソッドを提供します。null 安全な操作により、文字列の操作が強化され、実行時エラーのリスクが低減されます。このパッケージは、トリム、分割、検証、文字列の変換などの一般的なテキスト処理タスクを簡素化することを目的としており、クリーンで読みやすいコードを維持しています。複数のプラットフォームで文字列処理を改善したい開発者に最適です。

用途

  • 文字列の検証
  • ヌル安全な文字列操作
  • テキスト書式設定
  • データパース
  • 入力のサニタイズ
  • 国際化サポート

主な機能

  • String クラスに追加のメソッドを拡張します
  • null安全ユーティリティ
  • 包括的な文字列操作
  • クロスプラットフォーム互換性
  • pub を通じた簡単な統合
  • ドキュメントが充実した API

適している対象

  • Webおよびモバイルアプリ開発
  • フォーム入力処理
  • API データ処理
  • テキスト変換ワークフロー
  • コードの安全性を最優先とする開発者

注意事項

  • null セーフティの理解が必要です
  • 簡単なケースではわずかなオーバーヘッドが追加される可能性があります
  • 文字列固有のユーティリティに限定
  • 複雑な正規表現やパターンマッチング向けではありません
  • すでに null safety を使用しているプロジェクトに最適

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

The Strings package is an evolution of the work originally produced by Andrew Mezoni.

The purpose of the Strings package is to provide:

  • a collection of useful String functions to complement the core String class.
  • where viable, directly extend the String class with methods such as String.right, String.left...
  • provide a safer environment when working with nullable Strings (String?)
  • wrappers for each of the core String methods which are safe to use with a nullable String?.

A core objective of the Strings package is to never 'throw' or return an error but to make a best effort to process the passed data.

// passing null works too.
Strings.right(null, 4, pad: Pad.left);
 -> '    '

// pass a short string and we can pad it (or not).
Strings.right('one', 4, pad: Pad.left);
 -> ' one'

The Strings package also includes a number of methods exposed as extensions to the core Dart String class:

'a normal string'.right(4);
-> 'a no'

See the full list

The Strings package incudes over 50 functions.

You can see the full list including examples at:

strings.onepub.dev

Contributing:

The strings package is hosted on github at: github.com/onepub-dev/strings

Contributions are welcomed.

Sponser

The strings package is sponsored by OnePub - the private Dart repository SaaS.

onepub.dev

OnePub Logo

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト