Skip to content

dart-league/string_converters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String Converters

Build Status

I wrote this package since I realised I need this for quite a few projects when hitting dynamic code generation

This package helps you to convert the format of specific strings

Input string styles currently recognized

"Test Title", "Test word", "test Word", "table_name", 
"poly-name", "varName", "Title", "ClassName", "CONST_NAME"

Output should be

toVarName(string) ||
toLowerCamelCase(string)
"testTitle", "testWord", "testWord", "tableName", 
"polyName", "varName", "title", "className", "constName"

toClassName(string) ||
toUpperCamelCase(string)
"TestTitle", "TestWord", "TestWord", "TableName", 
"PolyName", "VarName", "Title", "ClassName", "ConstName"

toPolyName(string) || 
toLowerCaseWith(string,"-")
"test-title", "test-word", "test-word", "table-name", 
"poly-name", "var-name", "title", "class-name", "const-name"

toTableName(string) ||
toLowerCaseWith(string,"_")
"test_title", "test_word", "test_word", "table_name", 
"poly_name", "var_name", "title", "class_name", "const_name"

toConstName(string) ||
toUpperCaseWith(string,"_")
"TEST_TITLE", "TEST_WORD", "TEST_WORD", "TABLE_NAME", 
"POLY_NAME", "VAR_NAME", "TITLE", "CLASS_NAME", "CONST_NAME"

Example

  String polyName = toPolyName("CustomPolymerItem");

About

Converts strings to varName, lowerCamelCase, ClassName, UpperCamelCase, CONST_NAME, table_name, and poly-name

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages