Questions tagged [title-case]

In string or sentence formatting, title case is the term used for capitalizing the first character of each principal word.

In string or sentence formatting, title case is the term used for capitalizing the first character of each principal word.

95 questions
1
vote
2 answers

TitleCase In Visual C++

I'm currently trying to find an easy way to convert a Visual (Managed) C++ string to title case. In VB.NET, you can use either: StrConv(sampleString, vbProperCase) or sampleString =…
Sivvy
  • 853
  • 9
  • 28
1
vote
3 answers

Convert elements in a List to Title-Case?

I am trying to convert all list items to TitleCase. I thought TitleCase would be simple, but it does not seem to work the same as uppercase or lowercase. Any ideas? This is what works for upper and lower: List myList = new List() { "abc", "DEF",…
Jeagr
  • 1,038
  • 6
  • 16
  • 30
0
votes
4 answers

Capitalize last names including exceptions like mccall => McCall

I am having trouble with the capitalization of names using PHP. There are some names that have 2 capital letters in them (ex: McCall). When storing a users name that registers for our website, we run the following code: $name =…
three3
  • 2,756
  • 14
  • 57
  • 85
0
votes
0 answers

JavaScript RegEx for "Title Case" and names like McDonald

I am trying to title case all of the words in a string using a RegEx. I am using the following code (derived from another post) right now, but I think there has to be something better. My processing is as follows: Convert entire string to Lower…
Eric B
  • 91
  • 2
  • 9
0
votes
3 answers

Function to title case a string using javascript

I'm currently working on a fix where there's an existing function that capitalizes each word of the given string. Each value that comes out of that function is later used to validate other logic. So right now, that function is capitalizing texts in…
ypdev19
  • 173
  • 2
  • 13
0
votes
0 answers

textInfo.ToTitleCase Converts First letter capital eventhough culture info set as en-US

The following example was mentioned in below URL https://learn.microsoft.com/en-us/dotnet/standard/base-types/changing-case public class Example { public static void Main() { string[] values = { "a tale of two cities", "gROWL to the…
Prageeth Liyanage
  • 1,612
  • 2
  • 19
  • 41
0
votes
1 answer

How can I create a JS Method to convert a string to title case with exceptions and not manipulate the prototype?

I am trying to correct casing issues due to improper data input (writing in all CAPS, all lower case, or improper unit capitalizations) when returning records from and older DB. I found this solution for converting a string to title case, but I want…
Mtullis
  • 117
  • 9
0
votes
2 answers

How to title-case a string with some excluded word exceptions and how to collapse/trim additional white space sequences as well?

I haven't done a lot of work with regex, and I'm getting stuck. I'm trying to take a string and make it title case, but with some exceptions. I also want to remove any whitespace. Currently it's removing whitespace and the title case is working, but…
0
votes
1 answer

How to uppercase non-important words(for, a, an, the, is, then, etc.) , and uppercasing the JS in JavaScript:

I'm creating an APA titleCase function, and I'm trying to figure out how to uppercase non-important words(the, a, an, etc). So far I've only figured out how to either uppercase or lowercase all small words, even small words that should be…
JB49er
  • 15
  • 3
0
votes
0 answers

True title casing in various languages in .NET

I need to convert a bunch of text in different languages to their title case versions. According to the official MS documentation, ToTitleCase is not always linguistically correct because it usually always converts the first character to uppercase.…
user246392
  • 2,661
  • 11
  • 54
  • 96
0
votes
1 answer

Convert all words to title case except for acronyms

Would like to ask for any advice on how to convert a sentence in to Title case with the exception of acronyms (or any words that is in all caps) in Microsoft Word. Currently my code only converts all the sentences in a specific style in Title case.…
JP0710
  • 41
  • 6
0
votes
1 answer

I'm not getting any output in the correct code (2nd code)?

Hi and thanks in advance for any help. Here is the code that works with the proper output. first_name="ada" last_name="lovelace" full_name=f"{first_name} {last_name}" message=(f"Hello, {full_name.title()}!") print(message) Here is the similar code…
0
votes
1 answer

tools::toTitleCase vs stringr::str_to_title: What went wrong?

I was just trying to convert this upper-cased string to title case using the recommended tools package but couldn't until I used stringr::str_to_title(). This is the exact code I used: > tools::toTitleCase("TOOL 5a: ASSESSMENT TOOL FOR SOCIAL…
BroVic
  • 979
  • 9
  • 26
0
votes
1 answer

Applying Title Case (aka Proper Case) as a find & replace using regex in Notepad++

I am trying to apply Title Case (aka Proper Case) to multiple items in Notepad++ by using Regex. The expression i'm finding is: (?<=column caption=')(.*?)(?=') I just want to capitalise the start of each word. e.g. this is a test = This Is A…
pow
  • 415
  • 3
  • 8
  • 18
0
votes
5 answers

Title-case words in string that are only bordered by whitespace (or start/end of string)

I need to apply title-casing to my string, but with some exceptions. If the substring is separated by spaces and contains only letters, make the first letter uppercase and the rest lowercase. If there are letters and non-letters, they should remain…
Max .P.
  • 69
  • 4