|
-
Apr 11th, 2016, 10:24 AM
#1
ProperCase
Question... I am using the ProperCase to auto fix names entered...
txt.Text = StrConv(txt.Text, VbStrConv.ProperCase)
but, on occasion there are names that have multiple capitals like JoAnne or McAllister etc... is there any thing that knows how to deal with these? im guessing no... but thought I would ask to make sure.
If not, I will put make a checkbox to disable the autofix temporarily so the user can type it in.
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 11th, 2016, 10:47 AM
#2
Re: ProperCase
I'd avoid using the System.Microsoft.VisualBasic.StrConv method and instead use the System.Globalization.TextInfo.ToTitleCase method, but that's neither here nor there. In your case, there is no built-in method for handling special names like the ones you've mentioned. You'll have to handle it on a case by case basis(no pun intended).
-
Apr 11th, 2016, 11:07 AM
#3
Re: ProperCase
I agree with dday. Proper Names are ticklish when it comes to capitalization.
McDonald, MacDonald, and Macdonald are all separate Scottish surnames
First names are so made up these days anything goes.
Burn the land and boil the sea
You can't take the sky from me
~T
-
Apr 11th, 2016, 12:10 PM
#4
Re: ProperCase
Yep, you'll have to handle per culture for that. Here's an example asp.net app with extension methods that handles Irish names casing.
Github Project Casing Examples VB
-
Apr 11th, 2016, 12:16 PM
#5
Re: ProperCase
 Originally Posted by KGComputers
Yep, you'll have to handle per culture for that. Here's an example asp.net app with extension methods that handles Irish names casing.
Github Project Casing Examples VB
It appears as though the author used RegEx with a MatchEvaluator, I had initially thought doing this as it would be the most concise example, but then I thought that the OP should write it so that it would be specific to his situation. But that does seem that the most logical route to take.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|