Search packages, repositories and app categories

Package detailsv0.4.7

vy_string_utils

Collection of simple string and other types utilities.

AndroidiOSLinuxmacOSWebWindows
30-day downloads
86.8K
Likes
2
Pub points
160

Install package

flutter pub add vy_string_utils

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A lightweight Flutter/Dart package offering a collection of simple utilities for string manipulation and other basic type operations. It provides helpful methods for common tasks like trimming, validating, formatting, and transforming strings, improving code readability and reducing boilerplate. Designed to be straightforward and easy to integrate into any Dart project, it supports all major platforms including Android, iOS, Web, and desktop environments. Ideal for developers seeking quick, reliable string-handling tools without heavy dependencies.

Use cases

  • String validation
  • Text formatting
  • Input sanitization
  • Data transformation
  • Simple text processing
  • Cross-platform string utilities

Key features

  • Easy-to-use utility functions
  • Supports multiple platforms
  • Minimal dependency footprint
  • Clean and readable API
  • Focus on string and basic type operations
  • Well-documented methods

Suitable for

  • Beginner to intermediate Dart developers
  • Projects needing basic string helpers
  • Apps requiring consistent text handling
  • Lightweight utility needs
  • Rapid prototyping
  • Web and mobile applications

Considerations

  • Not intended for complex parsing
  • Limited to basic operations
  • No advanced regex or internationalization support
  • Best suited for simple use cases
  • Does not replace full-featured text processing libraries

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

README

A collection of string utilities.

These utilities simplifies some formatting needs. The main methods are:

  • cut() -> Cuts a String at the required length if bigger or returns the origin otherwise.

  • cutAndAlign() -> Cuts a String or pads it right or left with a certain character to the required length if needed

  • preserveOnlyChars() -> returns a String containing only the required characters. Optionally the removed characters can be substituted by a placeholder.

  • splitInLines() -> split a sentence in lines of the required length based on a given separator.

  • capitalize() -> Capitalize the first character of the string and lowercase the others.

  • onlyContainsDigits() -> returns true if the string contains only digits.

  • onlyContainsAlpha() -> returns true if the string only contains alpha characters (RegExp [a-zA-Z])

  • isDartIdentifier() -> returns true if the characters starting at the given position are a valid Dart identifier.

  • getDartIdentifier() -> return the valid Dart identifier (if any) at certain position in a source string.

    All these methods are presented also as extensions.

license.

Usage

A simple usage example:

import 'package:vy_string_utils/vy_string_utils.dart';

main() {
  print('please cut'.cutAndAlign(15, paddingChar: '*')); // 'please cut*****'

  print('main'.capitalize()); // 'Main'

  print('1953'.onlyContainsDigits()); // true
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.

Rankings