PC Review


Reply
Thread Tools Rate Thread

converting to proper case

 
 
ToddT
Guest
Posts: n/a
 
      5th May 2004
i'm trying to convert names to their proper case (e.g. "todd" ->
"Todd") using the following rountine:

Private Function ConvertToProperCase(ByVal stringValue As String)
As String
Dim ci As New
System.Globalization.CultureInfo("en-US", False)
Dim properCaseValue As String

properCaseValue = stringValue.Replace("'", "' ")
properCaseValue = ci.TextInfo.ToTitleCase(properCaseValue)
properCaseValue = properCaseValue.Replace("' ", "'")

Return properCaseValue
End Function ' ConvertToProperCase()


it works fine except when the name i pass in is all in upper case (it
remains in upper case). anybody know why or what i am doing wrong? thx
in advance.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFzb24=?=
Guest
Posts: n/a
 
      6th May 2004
Because you need to drop it all to lowercase firs

mystring.ToLower()

Then it should work.
 
Reply With Quote
 
ToddT
Guest
Posts: n/a
 
      6th May 2004
yes, this works. thx.

every other combination of upper case and lower case letters gets
converted correctly. how illogical...


On Wed, 5 May 2004 22:36:02 -0700, "Jason"
<(E-Mail Removed)> wrote:

>Because you need to drop it all to lowercase first
>
>mystring.ToLower();
>
>Then it should work.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting CAPS text to Proper Case rsantos17 Microsoft Excel Misc 1 4th May 2006 05:32 PM
Re: Converting Table to Proper Font Case Using ConvertTOProperCaseMod Steve Schapel Microsoft Access Macros 0 17th Jun 2004 06:24 PM
Need help converting a column of mixed case text to =PROPER() Russ Ragsdell Microsoft Excel Discussion 1 27th May 2004 12:17 PM
converting uppercase to proper case Susan Microsoft Access 4 31st Mar 2004 11:30 PM
Converting upper case to proper case in Excel angela Microsoft Excel Misc 1 13th Aug 2003 03:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:38 AM.