Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 12:49 PM
Nacho
Guest
 
Posts: n/a
Default first letter to uppercase

i need to convert the first letter of a veriable to uppercase (the veriable
is loaded and the applied LCase() )

thanks

--

Nacho


  #2  
Old July 19th, 2005, 12:49 PM
Dominique
Guest
 
Posts: n/a
Default Re: first letter to uppercase

I did this function and I use it to convert a string to PROPER CASE (first
letetr cap)

So we got LCASE()
and UCASE()

now we got PCASE :0)

pCase("this iS my string") ====> "This Is My String"
pCase("variablename") ====> "Variablename"
or
sVar = "variablename"

pCase(sVar) =====> "Variablename"

have fun!

function pCase(str) 'Check the cAsE on that
putCap = True 'First Letter Gonna be
Caps
myString = trim(str) 'Remove Leading and
Trailing Spaces
sInc = Chr(32) & Chr(9) & Chr(13) 'Charaters we look for (found
their char codes online sumwhere)
for iLen = 1 to Len(myString) 'Check each Character
mStr = Mid(myString, iLen, 1)
if putCap = true then 'From previous run -->
instructed to make this a UCASE char
bStr = bStr & UCASE(mStr)
else
bStr = bStr & LCase(mStr) 'LCASE char
end if
if instr(sInc, mStr) then 'Check if this is one
of our 'Triggers'(like a space or carriage return or tab)
putCap = true
else
putCap = false
end if
next
pCase = bStr 'eH Voila!
end function



"Nacho" <nachoingen@yahoo.com.ar> wrote in message
news:%236nuHVtGEHA.2576@TK2MSFTNGP11.phx.gbl...[color=blue]
> i need to convert the first letter of a veriable to uppercase (the[/color]
veriable[color=blue]
> is loaded and the applied LCase() )
>
> thanks
>
> --
>
> Nacho
>
>[/color]


  #3  
Old July 19th, 2005, 12:49 PM
Hans
Guest
 
Posts: n/a
Default Re: first letter to uppercase

Not sure if this is what you want but here we go...

yourVariable = "text in lower case"
yourVariable=Ucase(mid(yourVariable,1,1)) & mid(yourVariable,2)

You may have to take care of null values.

Regards
/Hans


  #4  
Old July 19th, 2005, 12:50 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: first letter to uppercase

Hans wrote on 05 apr 2004 in microsoft.public.inetserver.asp.general:
[color=blue]
> yourVariable = "text in lower case"
> yourVariable=Ucase(mid(yourVariable,1,1)) & mid(yourVariable,2)
>[/color]

yourVariable=Ucase(left(yourVariable,1)) & mid(yourVariable,2)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles