camelcasing

Algorithm to format text to Pascal or camel casing

Using this question as the base is there an alogrithm or coding example to change some text to Pascal or Camel casing. For example: mynameisfred becomes Camel: myNameIsFred Pascal: MyNameIsFred ...

JavaME: Convert String to camelCase

What would be a simple implementation of a method to convert a String like "Hello there everyone" to "helloThereEveryone". In JavaME support for String and StringBuffer utility operations are quite limited. ...

Best way to convert Pascal Case to a sentence

What is the best way to convert from Pascal Case (upper Camel Case) to a sentence. For example starting with "AwaitingFeedback" and converting that to "Awaiting feedback" C# preferable but I could convert it from Java or similar. ...

Why True/False is capitalized in Python?

All members are camel case, right? Why True/False but not true/false, which is more relaxed? ...

How can I cut(1) camelcase words?

Is there an easy way in Bash to split a camelcased word into its constituent words? For example, I want to split aCertainCamelCasedWord into 'a Certain Camel Cased Word' and be able to select those fields that interest me. This is trivially done with cut(1) when the word separator is the underscore, but how can I do this when the word i...

Does Resharper 4.1 support both Camel Humps and normal selection modes?

I've found the setting for Camel Humps in resharper: Resharper -> Options -> Editor -> Use CamelHumps The problem is that I would still like to be able to use the normal selection mode (i.e. the default behaviour for CTRL+Arrow and CTRL+SHIFT+Arrow) as well as the CamelHumps mode. For example consider this variable: private int MyVer...

Convert Pascal-cased setter to an underscore-separated variable name

This is not as simple as it seems. Most of you are likely thinking of the regex /([A-Z])/_$1/ like I have found all over the Internet, but my particular situation is slightly more complicated. My source string contains more content that I don't want to have converted before a portion that I do. Consider a regular setter: public funct...

Does the python standard library have function to convert CamelCase to camel_case?

Example: >>> convert('CamelCase') camel_case ...

Acronyms in Camel Back

I often see Java class names like XmlReader instead of XMLReader My gut feeling is to completely upper case acronyms, but apparently many people think differently. Or maybe it's just because a lot of code generators are having trouble with acronyms... So i would like to hear the the public opinion. How do you capitalize your class...

Should I create an attribute to make camel-cased table names, spaced?

I want to customize the headings of my tables outputted in a dynamic data website. Specifically, if a column has a name like "PhonebookManager", I want it to display, "Phonebook Manager" (note the space). Where should I be looking to get this done? ...

Does identifier casing really matter?

FxCop thought me (basically, from memory) that functions, classes and properties should be written in MajorCamelCase, while private variables should be in minorCamelCase. I was talking about a reasonably popular project on IRC and quoted some code. One other guy, a fairly notorious troll who was also a half-op (gasp!) didn't seem to agr...

CSS: camelCase vs under_score

There is much to read out there concerning this old question. Most languages seem to have their preferred style - and everythings ok with this. But what about this question of style in the CSS context? Both is correct and looks fine: someContainerContent vs. some_container_content What do you think? Which is your and what do you th...

Converting camel case to underscore case in ruby

Is there any ready function which converts camel case Strings into underscore separated string? I want something like this "CamelCaseString".to_undescore to return "camel_case_string" ...

camel case method names

I understand the reason to camel case variable names, but I've always wondered why you would camel case a method name? why is it toString() and not ToString()? What purpose does it serve? ...

For what reason do we have the lower_case_with_underscores naming convention?

Depending on your interpretation this may or may not be a rhetorical question, but it really baffles me. What sense does this convention make? I understand naming conventions don't necessarily have to have a rhyme or reason behind them, but why deviate from the already popular camelCase? Is there a rhyme and reason behind lower_case_with...

How to convert CamelCase to camel_case?

If I had: $string = "CamelCase"; I need "camel_case" Does PHP offer a function for this purpose? ...

Regex that matches Camel and Pascal Case

I'm about to write a parser for a language that's supposed to have strict syntactic rules about naming of types, variables and such. For example all classes must be PascalCase, and all variables/parameter names and other identifiers must be camelCase. For example HTMLParser is not allowed and must be named HtmlParser. Any ideas for a r...

Convert CamelCase xml/json to ruby named attributes with ActiveResource

I'm using ActiveResource to consume a REST service. The xml from the service looks like: <Person> <FirstName>Kevin</FirstName> <LastName>Berridge</LastName> </Person> ActiveResource parses this just fine, but it uses the names verbatim. So the model class will look like: p = Person.find(1) p.FirstName p.LastName I would much ...

Reformatting a Java String

I have a string that looks like this: CALDARI_STARSHIP_ENGINEERING and I need to edit it to look like Caldari Starship Engineering Unfortunately it's three in the morning and I cannot for the life of me figure this out. I've always had trouble with replacing stuff in strings so any help would be awesome and would help me understand...

How to camelcase decibels?

The standard abbreviations for decibels is "dB" (note the case!) So, if I have a variable, holding (for instance) a maximum dB value, how best to name it? maxDbValue maxdBValue maxDecibelValue something else? Each has disdvantages - #1 swaps the case of the unit, #2 doesn't clearly split max from dB, and #3 is verbose... I think #...