First Character Upper Case Only

Kenln

Registered User.
Local time
Today, 18:55
Joined
Oct 11, 2006
Messages
551
I have a string where all characters are upper case.

Is there a command to converall all characters to lower case except the first one.


P.S. I also have strings with more that one word. Like city names i.e. PALM SPRINGS s/b Palm Springs.

Thank you,
 
I have a string where all characters are upper case.

Is there a command to converall all characters to lower case except the first one.


P.S. I also have strings with more that one word. Like city names i.e. PALM SPRINGS s/b Palm Springs.

Thank you,




I am not aware of a command to do this, but a number of people have written functions that do this. Search the forum for more information. If all you want is the first character Upper and the rest Lower, then you could:
  • Break the string into two parts (First character and the rest of the string).
  • Use the upper() function on the First character of the string.
  • Use the lower() function on the rest of the string.
  • Put the string back together.
Note: It looks like there is such a function. See pbaldy's note below and follow his advice.
 
Last edited:
Look at the StrConv function and see if it does what you want:
 
Gosh, let's just give the whole fish then:

?strconv("paul baldy",vbProperCase)
Paul Baldy
 
Gosh, let's just give the whole fish then:

?strconv("paul baldy",vbProperCase)
Paul Baldy

Not everyone knows what ProperCase is. They know what it is when they see it but they don't necessarily know what it is called.
 
Gosh, let's just give the whole fish then:

?strconv("paul baldy",vbProperCase)
Paul Baldy

OOH! That might do what the Op wants then. Your example indicates that the vbProperCase filter works on words, and that a space resets the counter allowing the next word to be proper. My interpretation was that the OP wanted the First character to be Upper and the rest Lower. The Op did not specify whether or not there could be spaces.
 
Wow!!

Thanks guys,

Have a great weekend...
 
I still think his education should be completed by searching out the functions that deal with McCoy and O'reilly plus hyphenated words ie no space.

Brian
 
I still think his education should be completed by searching out the functions that deal with McCoy and O'reilly plus hyphenated words ie no space.

Brian

Very good Point! That was partly what I was referring to when I stated that a number of people had alread written Functions to handle this situation..
 
Very good Point! That was partly what I was referring to when I stated that a number of people had alread written Functions to handle this situation..

I guessed it was and was reinforcing the point, I thought I had mentioned you but must have had a senior moment. :)

Brian
 

Users who are viewing this thread

Back
Top Bottom