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
0
votes
1 answer

How to replace underscores with spaces and apply title casing to column name strings with preg_replace_callback()?

I can't seem to get the preg_replace() to change to preg_replace_callback(). In an attempt to make database table columns more human-friendly when I display them, I am trying to replace underscores with spaces and make every word start with a…
0
votes
0 answers

Convert string into Title case within a nested list

I have a nested list, and I'm trying to capitalize all the titles (the third element in each nested list i.e. cardinal richelieu etc.). Can't seem to wrap my head around the right approach. I thought replace would work, but I'm getting an error:…
0
votes
1 answer

No module named titlecase (existence confirmed)

I tried to use the package called "titlecase" (https://pypi.python.org/pypi/titlecase) My code works on jupyter notebook but it does not work when I tried to run it in cmd. Here is my code: from __future__ import print_function import datetime now…
G Xie
  • 1
0
votes
3 answers

Converting string with html styling ags to title case

I'm using this function to convert text to title case: function strtotitle($title) { $smallwordsarray = array( 'of','a','the','and','an','or','nor','but','is','if','then','else','when',…
NewJenk
  • 64
  • 1
  • 5
0
votes
1 answer

Jquery formatting input to Title / Proper Case not working on mobile

I'm using the following script and have tried others. While regex works on desktop computers it does not work on mobile. Testing with chrome and firefox browsers on samsung galaxy phone When I type the first letter of a word in the input textbox, I…
Cliff T
  • 227
  • 2
  • 11
0
votes
0 answers

Challenge: How to do Title case with only Upper and Lower?

Acumatica doesn't have a Title function... so I have a challenging question: How can we create a Title function when there is only Upper and Lower function? Below are the text functions currently available in Acumatica.
Ahmed
  • 267
  • 3
  • 16
0
votes
0 answers

Convert Title Case Text to camelCaseText

How would I convert Hello World to helloWorld? Currently trying: 'Hello World'.replace(/\b ([A-Z]?)/g, function(v) { console.log(v);return v.toLowerCase(); }) }) I.e., plan is to match 'word boundary, space, uppercase letter' and then replace with…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
0
votes
4 answers

Converting string to proper title case

I have this exercise: Write a Title class which is initialized with a string. It has one method -- fix -- which should return a title-cased version of the string: Title.new("a title of a book").fix = A Title of a Book You'll need to use…
Matt White
  • 117
  • 13
0
votes
1 answer

Change Firefox Bookmarks To TitleCase (Capitalize Each Word)

This My First Question Hear In Stack Overflow, And I Wish To Get The Help I Expect.. I Was Looking For A Way To Change All The Firefox Bookmarks Titles To 'TitleCase' . I've already found a perfect technique to change it to UPPERCase using a fierfox…
Karim
  • 1
  • 2
0
votes
1 answer

Title case handling issue in C#

I have a requirement where every word in a string should be converted to title case but my exact convertion is as follows : My present code is as follows : row[col.ColumnName] =…
0
votes
1 answer

titlecase script to find and replace strings within elements in multiple files

I would like to use John Gruber's titlecase script (converts strings to titlecase with small-word exceptions). My specific task is to search through multiple files and replace text strings within specific elements only (for example only h1's of a…
user2387823
  • 141
  • 1
  • 5
0
votes
4 answers

In Java how do you Title Case a String while preserving some common abbreviations

There are many ways to Title Case in java. But how do you prevent some of the common abbreviations from being converted. For Example; System.out.println(makeProper("JAMES A SWEET"); System.out.println(makeProper("123 MAIN ST SW"); James A…
Eric Labashosky
  • 29,484
  • 14
  • 39
  • 32
-1
votes
2 answers

Convert array of mixed type elements to title-cased string

I have an array containing integers and letters and I need to remove the integers and form a string which is all lowercase except the first letter. $chars = ["A", 1, 2, "h", "m", "E", "D"]; //Needed Output is: Ahmed My attempt: foreach ($chars as…
-1
votes
1 answer

Why is Python .title() sticky? Applying title case to future strings?

This is a strange one: I'm trying to format a string in python (obviously), and when I use string.title(), it seems like python keeps applying title case to the string, even after applying other formatting to the string. Here's my code: def…
-1
votes
1 answer

Active Directory vbscript case conversion

I need some help with my script. The full script can be found here The portion of the script I need help with is this: If (Len(strTitle) > 3) Then arrStr = Split(strTitle," ") For i=0 To UBound(arrStr) word = LCase(Trim(arrStr(i))) …
Amy Ling
  • 111
  • 5