473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

converting to proper case

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.

Jul 21 '05 #1
2 2100
Because you need to drop it all to lowercase firs

mystring.ToLower()

Then it should work.
Jul 21 '05 #2
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"
<an*******@discussions.microsoft.com> wrote:
Because you need to drop it all to lowercase first

mystring.ToLower();

Then it should work.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joseph Suprenant | last post by:
I have an array of unsigned chars and i would like them converted to an array of ints. What is the best way to do this? Using RedHat 7.3 on an Intel Pentium 4 machine. Having trouble here, hope...
10
by: jose.jeria | last post by:
I use the following to convert uppercase to lowercase: translate($queryString, 'ABCDE...', 'abcde...') But how can i convert the case for umlauts? φεδ etc
2
by: Rosy Moss | last post by:
I am in the process of cleaning up a database that our company uses to track jobs, time and expense, and customer information. We are running Windows 2000 Server with approximately 20 terminals...
7
by: djc | last post by:
I have typically always used one of the VB CType functions (not CType itself but CInt, CString, etc...) to cast/convert an input value to its proper type before passing it as a parameter to a SQL...
2
by: ToddT | last post by:
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 ...
9
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived)...
2
by: s.danyal.k | last post by:
Hi All, I have created an application in C# that converts HTML file to MS word documents. The HTML file may also have images , for e.g "<img src='http://www.google.com.pk/images/hp0.gif'></img>"....
116
by: Dilip | last post by:
Recently in our code, I ran into a situation where were stuffing a float inside a double. The precision was extended automatically because of that. To make a long story short, this caused...
3
by: Jone | last post by:
Hello, I have tried to convert a Mac text file to Windows using code below. Encoding Win = Encoding.GetEncoding("Windows-1252"); Encoding Mac = Encoding.GetEncoding("macintosh"); byte...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.