Results 1 to 6 of 6

Thread: Help: How to manipulate String? (Uppercase and Lowercase)

  1. #1

    Thread Starter
    Addicted Member coolwater's Avatar
    Join Date
    Dec 2004
    Location
    philippines
    Posts
    215

    Question 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.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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)

  3. #3

    Thread Starter
    Addicted Member coolwater's Avatar
    Join Date
    Dec 2004
    Location
    philippines
    Posts
    215

    Resolved 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.

  4. #4

    Thread Starter
    Addicted Member coolwater's Avatar
    Join Date
    Dec 2004
    Location
    philippines
    Posts
    215

    Wink 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.

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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?

  6. #6

    Thread Starter
    Addicted Member coolwater's Avatar
    Join Date
    Dec 2004
    Location
    philippines
    Posts
    215

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width