Formatting strings in CR 6

I´m using Crystal Reports 6 and I want a string to be display in a specific format (for example "123456" should look like "12 34 56"). How do I do that?
polksolkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JuiletteCommented:
'example of showing a formatted phone number
'by building a formula in crystal reports

'start number = 1234567890
'after formula = (123)-456-7890

'insert formula..name it...PhoneNumber
'the basis of the formula is:

'Pcode is the name of my variable I am assigning to StringVar
'punctation is important...(:=) and at end (;)

'StringVar PCode := [your character] + [tablename.fieldname][number of 'characters from  startnumber or alpha sting] + [your character] ;

StringVar PCode := "(" + {Phone.HomePhone}[1 to 3] + ")-";
StringVar PCode3 := {Phone.HomePhone}[4 to 6] + "-";
StringVar PCode4 := {Phone.HomePhone}[7 to 10] ;
PCode + PCode3 + PCode4

'in the end we just join the three strings we have created
'and we end up with a formatted phone number (123)-456-7890
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.