Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Dart library for changing String case style to the desired convention.

License

NotificationsYou must be signed in to change notification settings

Jesway/dart_casing

Repository files navigation

pub package

Thedart_casing package provides various casing utilities to convert strings between different cases. Below are the supported cases with examples:

Installation

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

dependencies:  dart_casing:<latest version>

Usage

import'package:dart_casing/dart_casing.dart';main(){var text="Lorem-ipsum_dolor\\SIT amet";// Camel Caseprint(Casing.camelCase(text));// loremIpsumDolorSitAmetprint(Casing.camelCase("myPascalCaseWord"));// myPascalCaseWord// Pascal Caseprint(Casing.pascalCase(text));// LoremIpsumDolorSitAmetprint(Casing.pascalCase("myCamelCaseWord"));// MyCamelCaseWord// Title Caseprint(Casing.titleCase(text));// Lorem Ipsum Dolor Sit Ametprint(Casing.titleCase("my_snake_case_word"));// My Snake Case Word// Snake Caseprint(Casing.snakeCase(text));// lorem_ipsum_dolor_sit_ametprint(Casing.snakeCase("myCamelCaseWord"));// my_camel_case_word// Kebab Caseprint(Casing.kebabCase(text));// lorem-ipsum-dolor-sit-ametprint(Casing.kebabCase("MyPascalCaseWord"));// my-pascal-case-word// Dot Caseprint(Casing.dotCase(text));// lorem.ipsum.dolor.sit.ametprint(Casing.dotCase("myCamelCaseWord"));// my.camel.case.word// Constant Caseprint(Casing.constantCase(text));// LOREM_IPSUM_DOLOR_SIT_AMETprint(Casing.constantCase("myCamelCaseWord"));// MY_CAMEL_CASE_WORD// Lower Caseprint(Casing.lowerCase(text, separator:" "));// lorem ipsum dolor sit ametprint(Casing.lowerCase("MY_CONSTANT_CASE_WORD"));// my constant case word// Upper Caseprint(Casing.upperCase(text, separator:" "));// LOREM IPSUM DOLOR SIT AMETprint(Casing.upperCase("myCamelCaseWord"));// MY CAMEL CASE WORD}

Notes

  • The package handles various input formats, includingCamelCase,PascalCase,snake_case,kebab-case,dot.case,Title Case,CONSTANT_CASE, and words separated by spaces or other symbols.

  • You can also specify a custom separator fortitleCase,lowerCase, andupperCase methods to join the words.

Issues

Please file any issues, bugs or feature requesthere.

License

This project is licensed under theMIT License

About

Dart library for changing String case style to the desired convention.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp