Capital Letters

M

Miguel Orrego

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.
 
M

Mike

Miguel Orrego said:
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?
 
R

Randy Rahbar

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
 
R

Randy Rahbar

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
 
E

Evertjan.

Randy Rahbar wrote on 19 aug 2003 in
microsoft.public.inetserver.asp.general:
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.
 
D

Don Verhagen

In Miguel Orrego <[email protected]> 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.
 
D

Dave Anderson

Evertjan. said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top