Lower/Upper case

TonySh

New Member
Hi there,

Does anyone have a code that would convert the 1st letter of a sentence to an upper case character and the rest of the sentence to a lower case?

Thank you.
 

amazing66

New Member
Could maybe use something like the following:

def var lc_unformatted as char
init 'this is the First sentence. this is the Second.' no-undo.
def var lc_temp as char no-undo.
def var lc_sentence as char no-undo.
def var li_x as int no-undo.

do li_x = 1 to num-entries(lc_unformatted, '.') - 1:
lc_temp = left-trim(entry(li_x, lc_unformatted, '.')).
lc_temp = caps(substring(lc_temp, 1, 1)) + substring(lc_temp, 2) + '.'.
lc_sentence = (if lc_sentence = '' then ''
else lc_sentence + ' ') + lc_temp.
end.
 

TonySh

New Member
Hi,

This will work if you only want to convert first letter of each sentence to upper case. I need to convert every other word to lower case.
Thanks for reply though.
 
Top