Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Manipulation

Status
Not open for further replies.

martin250

Programmer
Feb 26, 2002
11
0
0
GB
Hi, I'm trying to take a surname string with a hyphen in it, and make both names before and after the hyphen PROPER case.
m.surname = "SALLY-ANNE"
I need it to print out... Sally-Anne
I have tried for awhile without any success. Please can you help.

Thanks in Advance.

Mart
 
hey mart, Try:
m.surname = "SALLY-ANNE"

lc_last = SUBSTR(m.surname,RAT("-",m.surname)+1)
lc_first = LEFT(m.surname, RAT("-",m.surname) - 1)

lc_name = PROPER(lc_first) + "-" + proper(lc_last)

Regards
EMC
 
Mart,

This thread184-551143 is from the Visual FoxPro forum, but you may find it helpful too.
 
Thanks EMC, thats exactly what I was after.
It works great :) TY

Thanks also mlv1055 for the info on that thread.

Mart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top