× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I assumed Jeff meant "1st-letter-upper-otherwise-lower". Hence the casing of
his question:

Is there an API or sample code for converting a text string from UPPER
CASE to Drop Case?

Any, the quick answer is that there isn't a single API. However, you could
do something like this (untested):

string = %xlate( UpperChars : LowerChars : string );
ConvertToUpper = *off;
for x = 1 to %len( string );
char = %subst( string : x : 1 );
if ConvertToUpper = *on and char <> ' ';
string = %xlate( LowerChars : UpperChars : char );
%subst( string : x : 1 ) = char;
ConvertToUpper = *off;
else;
if char = ' '; <=======
ConvertToUpper = *on;
endif;
endif;
endfor;

Although maybe you only want to capitalize the first letter in a sentence,
so you'd use this at <=======:

if char = '.' and %subst( string : x + 1 : 1 ) = ' ';

although that would throw an error if the last character in the string is a
period. Plus you'd be better off basing char on a pointer, to avoid all
those silly substrings back and forth.

And maybe I was wrong about what Jeff wanted anyway.

Rory

On Fri, Apr 10, 2009 at 1:04 PM, Alan Shore <AlanShore@xxxxxxxx> wrote:


What is "Drop Case"?
Is it another name for lower case?

Alan Shore

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.