How to Convert a C++ String to Uppercase

You need to put a double colon before toupper: transform(input.begin(), input.end(), input.begin(), ::toupper); Explanation: There are two different toupper functions: toupper in the global namespace (accessed with ::toupper), which comes from C. toupper in the std namespace (accessed with std::toupper) which has multiple overloads and thus cannot be simply referenced with a name only. You … Read more

Naming convention for upper case abbreviations [closed]

There is no one correct answer. This wiki extract is helpful: Programming identifiers often need to contain acronyms and initialisms which are already in upper case, such as “old HTML file”. By analogy with the title case rules, the natural camel case rendering would have the abbreviation all in upper case, namely “oldHTMLFile”. However, this … Read more

Uppercase first letter in NSString

Please Do NOT use this method. Because one letter may have different count in different language. You can check dreamlax answer for that. But I’m sure that You would learn something from my answer. NSString *capitalisedSentence = nil; //Does the string live in memory and does it have at least one letter? if (yourString && … Read more

Turkish case conversion in JavaScript

Coming back to this years later to provide more up to date solution. There is no need for the hack below, just use String.toLocaleUpperCase() and String.toLocaleLowerCase() “dinç”.toLocaleUpperCase(‘tr-TR’) // “DİNÇ” All modern browsers support this now. [ OLD, DO NOT USE THIS ] Try these functions String.prototype.turkishToUpper = function(){ var string = this; var letters = … Read more

Use Java and RegEx to convert casing in a string

You can’t do this in Java regex. You’d have to manually post-process using String.toUpperCase() and toLowerCase() instead. Here’s an example of how you use regex to find and capitalize words of length at least 3 in a sentence String text = “no way oh my god it cannot be”; Matcher m = Pattern.compile(“\\b\\w{3,}\\b”).matcher(text); StringBuilder sb … Read more