Important alert: (current site time 7/15/2013 11:29:01 PM EDT)
 

VB icon

ASP/VBS Case conversion

Email
Submitted on: 6/22/2000 6:47:41 PM
By: LoKi-ZA  
Level: Beginner
User Rating: Unrated
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 21377
(About the author)
 
     Simple function that converts a string to Mixed case (very easy, but very useful)
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: ASP/VBS Case conversion
' Description:Simple function that converts a string to Mixed case (very easy, but very useful)
' By: LoKi-ZA
'
' Inputs:Pass one string
'
' Returns:Another string
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6235&lngWId=4'for details.'**************************************

function convertname(name)
	name=replace(left(name,1), left(name,1), UCase(left(name,1))) & right(name,len(name)-1)	
	convertname=name
end function


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/23/2000 2:08:13 PMDon Blaylock

Daz:Your code is OK but it doesn't handle calls like this: ConvertName(
(If this comment was disrespectful, please report it.)

 
6/23/2000 2:10:30 PMDon Blaylock

Function ProperCase(Name)
Dim vBuffer
Dim sBuffer
Dim i
vBuffer = Split(Name, " ")
sBuffer = ""
For i = 0 To UBound(vBuffer)
sBuffer = sBuffer & " " & Replace(Left(vBuffer(i), 1), Left(vBuffer(i), 1), UCase(Left(vBuffer(i), 1))) & Right(vBuffer(i), Len(vBuffer(i)) - 1)
Next
ProperCase = Trim(sBuffer)
End Function

Response.Write ProperCase("don ' the vb guru ' blaylock")

(If this comment was disrespectful, please report it.)

 
6/23/2000 2:11:40 PMDon Blaylock

PSC is reformatting my code here but you should get the idea... ;-o)
(If this comment was disrespectful, please report it.)

 
6/24/2000 4:40:10 AMDaz B

Calls like this? (like what?)
Tnx for the feedback...yeah, i see what you're getting at, but for a simple case conversion, why go to all that trouble. All i wanted was a func that could convert case for the proj i was working on. Readers (lol) - use Don's code...mine's too select.
(If this comment was disrespectful, please report it.)

 
3/29/2005 7:57:29 PMFUCCI, Leonardo Hernan

function stUcase(lalala)
'in one line
stUcase = Ucase(Mid(lalala,1,1)) & lCase(Mid(lalala,2))

end function


good luck
(If this comment was disrespectful, please report it.)

 
12/21/2008 5:50:35 PMJohn Avison

Don Blaylock, rethink your code....what if the string that get passed is already in UPPERCASE? It wont do bugger all
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.