473,408 Members | 2,427 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,408 software developers and data experts.

Capital Letters

I have a form which people use to register in a database. The form passes
the input data to an asp page that then updates the database.

The thing is, people often don't bother starting their firstname & surname
with a capital letter on the form. When this data is dispalyed on other
pages it would look so much better if they did.

Does anybody know a way of manipulating the input so that I can substitute
the first letter of an input string for a capital letter before I update the
database?

Some code would be great.

Cheers.
Jul 19 '05 #1
7 6615
"Miguel Orrego" <mi****@stressedmonkey.net-nospam> wrote in message
news:3f***********************@news.dial.pipex.com ...
I have a form which people use to register in a database. The form passes
the input data to an asp page that then updates the database.

The thing is, people often don't bother starting their firstname & surname
with a capital letter on the form. When this data is dispalyed on other
pages it would look so much better if they did.

Does anybody know a way of manipulating the input so that I can substitute
the first letter of an input string for a capital letter before I update the database?

Some code would be great.


fname = ucase(left(firstname, 1)) & right(firstname, len(firstname)-1)

Seems kinda sloppy, but it should work. Any quicker methods?

--
Mike
Jul 19 '05 #2
> Does anybody know a way of manipulating the input so that I can substitute
the first letter of an input string for a capital letter before I update the database?


firstname = capit(firstname)

function capit(str)
str = ucase(left(str,1)) & mid(str,2)
end function
Jul 19 '05 #3
Mike wrote:
"Miguel Orrego" <mi****@stressedmonkey.net-nospam> wrote in message
news:3f***********************@news.dial.pipex.com ...
...
Does anybody know a way of manipulating the input so that I can
substitute the first letter of an input string for a capital letter
before I update the database?

Some code would be great.


fname = ucase(left(firstname, 1)) & right(firstname, len(firstname)-1)

Seems kinda sloppy, but it should work. Any quicker methods?


depends on what use the data is required for.

To output to HTML one could employ CSS: see 'text-transform' and
'first-letter' in your favourite search engine.

--
William Tasso - http://WilliamTasso.com
Jul 19 '05 #4
> function capit(str)
str = ucase(left(str,1)) & mid(str,2)
end function


Oops... this should read..

function capit(str)
capit= ucase(left(str,1)) & mid(str,2)
end function
Jul 19 '05 #5
Randy Rahbar wrote on 19 aug 2003 in
microsoft.public.inetserver.asp.general:
function capit(str)
str = ucase(left(str,1)) & mid(str,2)
end function


Oops... this should read..

function capit(str)
capit= ucase(left(str,1)) & mid(str,2)
end function


capit= ucase(left(str,1)) & lcase(mid(str,2))

Some people are called O'Brian:

=====================

Function ProperCase(a)
b=""
notyet=true
For i=1 to Len(a)
m=mid(a,i,1)
If notyet Then
b=b+Ucase(m)
Else
b=b+Lcase(m)
End If
If Ucase(m)=Lcase(m) Then
notyet= true
Else
notyet=false
End If
Next
ProperCase=b
End Function

=====================

For a Dutch site,
the lowering of "van", de", "der" should be considered.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #6
In news:3f***********************@news.dial.pipex.com ,
Miguel Orrego <mi****@stressedmonkey.net-nospam> typed:
: I have a form which people use to register in a database. The form
: passes the input data to an asp page that then updates the database.
:
: The thing is, people often don't bother starting their firstname &
: surname with a capital letter on the form. When this data is
: dispalyed on other pages it would look so much better if they did.

Not to be too coy, but it would look better to *you*. Why decide? Let the
user type the name in how they want to it appear (with obvious limitations
on "special/extended" characters). Give the user the ability to change the
way their name appears and leave it at that.

As mentioned in another post a dutch name with "de" should be left in lower
case, you would suggest changing it to:

Hans de Husen to Hans De Husen, which to the user, would not "look much
better" if you did.

My 2 cents, don't sweat the small stuff.

Don Verhagen
Tandem Staffing Solutions, Inc.


: Does anybody know a way of manipulating the input so that I can
: substitute the first letter of an input string for a capital letter
: before I update the database?
:
: Some code would be great.
:
: Cheers.
Jul 19 '05 #7
"Evertjan." wrote:

Yes, empty strings exist.

No, you cannot type them in.


I am, for better or worse, stuck with a mind that accepts nothing at face
value, so I gave this some thought, and concur.

I note, however, that (a) you can un-type a non-empty string (thus making it
empty), and (b) you can type a NULL value in Enterprise Manager (CTRL+0).
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #8

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

Similar topics

2
by: Jeff | last post by:
Hi, I am trying to insert a space before all capital letters in a string except the first occurrence. For example: FirstSecondThird would become First Second Third Is there a regular...
4
by: Carlos Marangon | last post by:
Hello! People go to sign my guestbook and wrote all text in capital letters. Did you know any script that shows an window alert when one types the second capital letter? Best regards,
1
by: thomaz | last post by:
How I can place in capital letters the text of a COMBOBOX? For TEXTBOX I use: textBox1.CharacterCasing = CharacterCasing.Upper;... How to make the same for a COMBOBOX? There isnt a...
3
by: Bertha94 | last post by:
I am trying to set certain cells to capitalize any input whethere they have the caps lock on or not. I have toyed with "Private Sub Workbook_SheetChange" to turn all changes into an object with...
0
by: wbosw | last post by:
I'm trying to create a regex to find more than one capital letter position within a word. The below regex, finds the first capital letter in the word and returns the index for that character. I...
2
by: inferi9 | last post by:
hi, I am writng a program that takes a string and it must output if it is a palindrome, A palindrome is a string that is spelled and read the same way forward and backward, it workes fine with...
3
by: phpmel | last post by:
I have a username that is Joined together as follows JohnSmith The first letter in each of the first and last name is Capital Can some one help me write a php function to split the name and get...
5
Presto731
by: Presto731 | last post by:
HOW do i make the letters in various fields on a form always be capital no matter if they used capital letters or not when typing?
1
by: minimatrix | last post by:
Hi guys just wandering if I could get a little help! , I have wrote a Perl script to sort out some data in my database, I am saving into an sql file but having a few problems executing the sql...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.