Convert a string to proper case

Date:15 July 2005
Product/Release:Visual LANSA
Abstract:Convert a string to first character upper case, all others lower case
Submitted By:LANSA Technical Support

The following Method routine changes the 1st character in a string to uppercase and leaves the rest of the characters as lowercase.

Mthroutine Name(Proper_Case) Help('Convert a string to proper case: first character upper case, all others lower case')
Define_Map For(*input) Class(#prim_alph) Name(#Subject)
Define_Map For(*Result) Class(#prim_alph) Name(#Result)

If (#subject.trim *NE "")

#Result := #subject.lowercase.replacesubstring( 1, 1, (#subject.substring( 1, 1 ).uppercase) )

Endif

Endroutine