If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Capitalize First Letter of Each Word

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-06, 04:03
gtk gtk is offline
Registered User
 
Join Date: Oct 2004
Location: Paris, FRANCE
Posts: 132
Post Capitalize First Letter of Each Word

I need to format strings like:
Code:
this string needs to be each first letter capitalized
/* to */
This String Needs To Be Each First Letter Capitalized
I had already done that
Code:
SELECT
 CONCAT(
  UPPER(SUBSTRING("string to capitalize", 1, 1)),
  LOWER(SUBSTRING("string to capitalize", 2,
   CHAR_LENGTH("string2capitalize"))
  )
 ) AS "Capitalized"



+----------------------+
| Capitalized          |
+----------------------+
| String to capitalize |
|                      |
+----------------------+
But it capitalizes only the first letter of the string
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On