473,412 Members | 4,196 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,412 software developers and data experts.

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
Jul 19 '05 #1
3 4681
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" <na********@yahoo.com.ar> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
i need to convert the first letter of a veriable to uppercase (the veriable is loaded and the applied LCase() )

thanks

--

Nacho

Jul 19 '05 #2
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
Jul 19 '05 #3
Hans wrote on 05 apr 2004 in microsoft.public.inetserver.asp.general:
yourVariable = "text in lower case"
yourVariable=Ucase(mid(yourVariable,1,1)) & mid(yourVariable,2)


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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

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

Similar topics

4
by: dave | last post by:
Hi How to make first letter of word in upper case? i.e. hello should return Hello Is there any inbuilt function?? Thanx dave
1
by: Dwight Shubert | last post by:
Hi all, This is my first try using Access. I understand how to format a text field for uppercase and lowercase, but how do you capitalize only the first letter of each word? tia Dwight
2
by: blabla120 | last post by:
In an element of my source xml file, II have an attribute method="getSurfaceNumber". I want to make a XSL transformation to a target file. In the target file, I want to give out the mehod name...
3
by: shapper | last post by:
Hello, How can I make the first letter of a string to be upper case and all the others lower case? Thanks, Miguel
2
by: setabery | last post by:
When entering a value to a field, is there a way to make only the first letter upper case without using the Shift Key? For example, entering a name.
14
by: fniles | last post by:
In VB.NET 2005 can I check if a letter in a string is upper case or lower case ? For example: I have the following 2 lines: NQ,Z2003,11/11/2003,1416.5,1420,1402,1411.5...
5
by: Middletree | last post by:
I want to take a value that users type into a field (actually 2 fields--first and last name) and convert the first letter to Upper Case. I htought I could use UCase, but it seems to only work for...
2
karthickkuchanur
by: karthickkuchanur | last post by:
if((document.forms.employeeId.value == 0) && (document.forms.applicantId.value == 0)) { alert("Please Select the "+document.forms.type.value+" Code or Name"); return false; } i...
1
by: Germaris | last post by:
Hi there! Nowadays trend is to write everything in lowercase. Last Names, First Names, City Names, etc... Maybe the use of computers is one of the reasons to such bad typing. In a form,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.