Actually it is rather simple. Format it to vbProperCase (i.e.
strConv(and Vb should do it for you. If you are like me and do not know
of proper case you can Ucase the first letter and then loop through the
string and after each space do a Ucase.
Yehuda
-----Original Message-----
From: Daniel O'Dorisio [mailto:dodorisio@h...]
Sent: Wednesday, June 27, 2001 2:33 PM
To: professional vb
Subject: [pro_vb] RE: select first letter of each word
hmm interesting.. thanks. ill definately take that into consideration.
yeah.. i have heard that string manipulation is terrible in vb.. what
else can i do?
thanks
daniel
-----Original Message-----
From: Marco Straforini [mailto:marco@c...]
Sent: Wednesday, June 27, 2001 1:40 PM
To: professional vb
Subject: [pro_vb] RE: select first letter of each word
Daniel,
keep in mind a gotcha I learned about the Split function:
if there are multiple instances of your separator character, Split
returns an empty strings. For example: "W1 W2 W3" (notice two blanks
between W2 and W3) Split returns:
a(0) =3D "W1"
a(1) =3D "W2"
a(3) =3D ""
a(4) =3D "W3"
As for performances, I agree that String manipulation in VB
is not that efficient, and you have to test it case by case. How long
are your strings anyway. I remember reading something in VBPJ about
speeding string performances. You can take a look at their web site.
m.
> -----Original Message-----
> From: Daniel O'Dorisio [SMTP:dodorisio@h...]
> Sent: Wednesday, June 27, 2001 10:13 AM
> To: professional vb
> Subject: [pro_vb] RE: select first letter of each word
>
> that is exactly what i was thinking of doing, just wondered if it
> would be to expensive
>
> thanks
> daniel
>
> -----Original Message-----
> From: Harry Jega Nathan [mailto:hjeganathan@y...]
> Sent: Wednesday, June 27, 2001 12:45 PM
> To: professional vb
> Subject: [pro_vb] RE: select first letter of each word
>
>
> create a function like this
>
> Dim strTest As String
> Dim strArray() As String
> Dim intCount As Integer
> Dim strOutr as String
> strTest =3D ""Orthopedic Surgery and Sports Medicine Specialists" "
> strArray =3D Split(strTest, " ")
>
> For intCount =3D LBound(strArray) To UBound(strArray)
> If Ucase(strArray(intCount)) <> "AND" Then
> StrOutr =3D strOutr &
> Ucase(Left(strArray(intCount),1))
> End If
> Next
>
>
> hope this is usefull
> Thanks
> Harry