View Single Post
Old 05-26-2003, 08:36 PM   #5
Ogma
Member
 
Ogma's Avatar
 
Join Date: Apr 2002
Home MUD: DartMUD
Posts: 86
Ogma is on a distinguished road
Perhaps it would have helped if you'd stated that you wanted to do it in LPC. Kavir gave you a solution in C, a completely different language. The solution in LPC would go something like this:

[code]
string alt_caps(string str) {
int i,j;

if (!str || str=="") return 0;
str=lower_case(str);
for(i=0,j=strlen(str);i<j;i+=2)
str[i..i]=capitalize(str[i..i]);
return str;
}
[/quote]
Ogma is offline   Reply With Quote