- Optimize Title Case
- Roman character UPPERCASE
- Reserved keywords UPPERCASE
- English preposition lowercase
- Fix issue where character after parenthesis is not capitalized in Title Case
- Fork this repository.
- Open file
lib/recase.dart
. - Modify the entry in
_englishSpecialTerm
function. The list contains English prepositions that should be lowercase all the time, except when it is located at the beginning of a sentence. - Or, modify the words in
_reservedWords
function. It is the phrase that has always been capitalized. Eg: IT. romanNumerals
. Roman numerals. I guess no need to add too many numbers in this entry. However, if it is needede, feel free to do so.- Use online tools like https://convertcase.net/ to verify the Title Case.
- Run test in
test/recase_test.dart
(Only the Title Case group). - Open a PR for your fixes.
Changes the case of the input text to the desire case convention.
import 'package:recase/recase.dart';
void main() {
ReCase rc = new ReCase('Just_someSample-text');
print(rc.camelCase); // Prints 'justSomeSampleText'
print(rc.constantCase); // Prints 'JUST_SOME_SAMPLE_TEXT'
}
String extensions are also available.
import 'package:recase/recase.dart';
void main() {
String sample = 'Just_someSample-text';
print(sample.camelCase); // Prints 'justSomeSampleText'
print(sample.constantCase); // Prints 'JUST_SOME_SAMPLE_TEXT'
}
This feature is available in version 3.0.0, and requires at least Dart 2.6
Supports:
- snake_case
- dot.case
- path/case
- param-case
- PascalCase
- Header-Case
- Title Case
- camelCase
- Sentence case
- CONSTANT_CASE