Conversion to snake case should convert only case, not other characters
See original GitHub issueLet’s have a string
\My\AppBundle\App\Twig\GoogleTagManagerDataLayer
I want to convert it to
my.app_bundle.app.twig.google_tag_manager_data_layer
That seems to be the exact case for string manipulation plugin. But it’s currently not possible. If I call “to snake_case” on it, it creates
my_app_bundle_app_twig_google_tag_manager_data_layer
I would expect the plugin to work on case (i.e. only convert [a-z][A-Z]
to \1_\2
) and not touch unknown characters. Current behaviour IMO severely limits use cases. What is this behvaiour’s use-case?
My other typical use case would be
Some\PHP\SubNamespace
-> some/php/sub-namespace.twig
(i.e. replace slashes + to hyphen-case)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
to_any_case: General case conversion in snakecase - Rdrr.io
Function to convert strings to any case. ... It should only be used in very rare use cases and is mainly implemented to...
Read more >Convert Strings into any Case • snakecase
The snakecase package introduces a fresh and straightforward approach on case conversion, based upon a consistent design philosophy.
Read more >Convert String to Different Case Styles ... - In Plain English
Snake case is the practice of writing compound words in which the words are separated by one underscore character and no spaces. The...
Read more >snakecase: Convert Strings into any Case
Description A consistent, flexible and easy to use tool to parse and con- vert strings into cases like snake or camel among others....
Read more >Snake case of a given sentence - GeeksforGeeks
Simple solution : First method is to traverse sentence and one by one replace spaces by underscores and changing case of first character...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow, thank you for speedy fix! ❤
You asked "What is this behvaiour’s use-case? " 😃