Gossamer Forum
Home : Products : DBMan : Installation :

Maximising the first letters

Quote Reply
Maximising the first letters
Hi,

I need to have the first letter of every word turned in to CAPS.

I know this is something which is not life or death, but when I am adding a product, I don't want it to sometimes display in lower case, and sometimes in upper case.

JPDeni, last time you REALLY helped me with the 25% off trick, and I am hoping you can help me with this too.

------------------
Thanks
JFrost



Quote Reply
Re: Maximising the first letters In reply to
Well, I'll give it a shot. Smile Someone asked about the same thing in the DBMan Discussion forum and said what I gave him didn't work. I tested it this time, though, so it should.

At the beginning of html_record, after the my (%rec) = @_; statement, but before the start of the print qq|, for each of the fields you want to convert, use

$rec{'FieldName'} =~ s/(\w+)/\u\L$1/g;

I suggest you just highlight and copy the line to your clipboard. It's a real bear to try to type! Smile

The only negative about this structure is that it will also capitalize letters after an apostrophe. That's fine if you are trying to capitalize a name like "O'Brien," but not so good if you have a word like "don't" in the field. It will come out "Don'T."

I'm glad the 25% off thing worked for you. Smile


------------------
JPD