Help: How to manipulate String? (Uppercase and Lowercase)
Hello. I have this problem in crystal reports. Is there an easy way to do the following?
Sample problem: "FIRST NAME"
I would like the string/text "FIRST NAME" to appear in crystal report like this "First Name".
My incomplete solution in the crystal Formula Editor. I did it like this: (see below)
Code:
uppercase(left({Contacts.FirstName},1)) + lowercase(right({Contacts.FirstName},(len({Contacts.FirstName})-1)))
I manage to have "FIRST NAME" appear like this "First name". Is the an easy way to have it appear like "First Name"?
Any suggestion will be highly appreciated. :)
Re: Help: How to manipulate String? (Uppercase and Lowercase)
The following is what I use (Crystal Syntax).
Code:
stringVar array values;
numberVar index := 0 ;
values := split({Contacts.FirstName});
for index := 1 to ubound(values) do
(
values[index] := uppercase(left(values[index],1)) + lowercase(mid(values[index],2))
);
join(values)
Resolved: Help: How to manipulate String? (Uppercase and Lowercase)
It worked. Thanks for the help. I did not know that we can do that code in crystal. Can you translate it in VB? Anyway, thank you very much.
Re: Help: How to manipulate String? (Uppercase and Lowercase)
Another problem. This is quite tricky. How would we do this in crystal?
"GEORGE W. BUSH III" to appear like this "George Bush W. III"
Again thanks for the help.
Re: Help: How to manipulate String? (Uppercase and Lowercase)
First you need to define the rules.
Are you saying all name strings with 3 or more names are always in the format first, middle, last?
My last name contains 3 "words". How would you expect to handle that situation? How about people with 2 second names?
Re: Help: How to manipulate String? (Uppercase and Lowercase)
Tnx for the reply. You are right. I know what you mean. The solution you gave me is very good. I'm going to use that style from now on. Tnx