Proper case label expression

144
2
Jump to solution
08-13-2012 01:28 PM
TanyaOwens
Occasional Contributor III
Hello,

I am trying to convert all caps to proper case with more than one word in the field. For example the text in the field is "IRONWOOD RIDGE DR" and I want it to display as "Ironwood Ridge Dr".  The example expression at
http://resources.arcgis.com/en/help/main/10.1/index.html#//00s800000027000000 capitalizes the first word and lowercase for all other words so I end up with "Ironwood ridge dr". Any help would be appreciated.

Thanks!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
TanyaOwens
Occasional Contributor III
Thanks for the help but in the meantime I found the code in the help dialog button that was perfect (who would think to look there - it has been a long Monday) :):

  Function FindLabel([Name])     var = [Name]    splitStr = Split(var, chr(32))    for i = 0 to UBound(splitStr)       tmpStr = Trim(splitStr(i))        if len(tmpStr) > 0 then tmpStr = UCase(Left(tmpStr,1)) & LCase(Right(tmpStr, Len(tmpStr) -1))    splitStr(i) = tmpStr    next    ProperCase = join(splitStr, " ")    FindLabel = ProperCase    End Function

View solution in original post

0 Kudos
2 Replies
AnthonyGiles
Frequent Contributor II
Tanya,

Have a look at this post:

http://forums.esri.com/Thread.asp?c=93&f=982&t=190787

Regards

Anthony
0 Kudos
TanyaOwens
Occasional Contributor III
Thanks for the help but in the meantime I found the code in the help dialog button that was perfect (who would think to look there - it has been a long Monday) :):

  Function FindLabel([Name])     var = [Name]    splitStr = Split(var, chr(32))    for i = 0 to UBound(splitStr)       tmpStr = Trim(splitStr(i))        if len(tmpStr) > 0 then tmpStr = UCase(Left(tmpStr,1)) & LCase(Right(tmpStr, Len(tmpStr) -1))    splitStr(i) = tmpStr    next    ProperCase = join(splitStr, " ")    FindLabel = ProperCase    End Function
0 Kudos