Request Feature Convert Case snake_case camelCase
-
greetings kind regards
am surprised snake and camel are not on the list of cases to convert to .
thank you kindly -
@Bernard
This is pretty easy to do with regular expressions in the find/replace form:
For both conversions, make sure theSearch Mode
of the find/replace form is set toRegular expressions
.Camel to snake:
FIND:
(?-i)([a-z])([A-Z])
REPLACE WITH:${1}_\l${2}
Snake to camel:
FIND:
(?-i)([a-z])_([a-z])
REPLACE WITH:${1}\u${2}
example of snake case (should be converted to camel by mySnake to camel
regex):_foo = __bar + now_is_the_time_for_all_good_men class foo_bar: def __init__(self, blah_man_zoo, _foo, baz_): self.blah_man_zoo = blah_man_zoo self._foo = _foo self.baz_ = baz_ def __repr__(self): return self._foo + self.baz_ def baz(_foo): return _foo
example of camel case (should be converted to snake by my
camel to snake
regex):_foo = __bar + nowIsTheTimeForAllGoodMen class fooBar: def __init__(self, blahManZoo, _foo, baz_): self.blahManZoo = blahManZoo self._foo = _foo self.baz_ = baz_ def __repr__(self): return self._foo + self.baz_ def baz(_foo): return _foo
-
Hello, @bernard, @mark-olson and All,
@bernard, see also this old post :
https://community.notepad-plus-plus.org/topic/130/convert-case-to/4
Note that some of the capitalisation rules, presented in this post, are now directly accessible, from within N++, via the
Edit > Convert Case To
menu option. !Best Regards,
guy038
-
Possibly of related interest: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13306
-
It sounds like you’re requesting a feature that allows you to convert text between snake_case and camelCase. This can be a useful utility for developers and anyone working with code. While I can’t directly implement features, I can provide you with a simple Python code snippet that demonstrates how you can convert text between these two cases. You can use this as a starting point to create a dedicated tool or integrate it into your projects
-
@Fenimoreson-Alvaro
It sounds like you’re using generative AI to create responses to topics in the forum. That can be a useful utility for developers and anyone working with code. Unfortunately, use of generative AI to respond to posts on this forum is banned.If that’s not what’s happening, and your post just happened to have the style of a ChatGPT response, then I apologize.