K
Ken Fine
No joy on Macromedia's boards after a few days; maybe someone can help me
here.
I got an excellent string handling function off of planet-source-code.com
that converts text strings to proper case, i.e. "the REMAINS of the DAY" is
converted to "The Remains Of The Day".
This function is particularly good in that it handles certain exceptions.
Can you help me make it handle more? I'm interested in two tweaks, one easy,
one hard.
The easy tweak: I have certain acronyms that I'd always like to NOT be
converted into proper case -- I want them all upper. For instance, "ASCII",
"SCSI" and "IDE" shouldn't be rendered as "Ascii" "Scsi" and "Ide". The list
of exceptions is short and I'd be fine hardcoding them into the function.
The hard tweak: Certain "noise words" such as "is" "and" and "but" don't
belong in proper case. I don't want them capitalized at all UNLESS they're
the first word in the string.
Can any stringmeisters take a crack at this? Code appears below. If anyone
can help out with at least the first item, I'd be most appreciative.
-KF
Adjusting string handling function for exceptions?
here.
I got an excellent string handling function off of planet-source-code.com
that converts text strings to proper case, i.e. "the REMAINS of the DAY" is
converted to "The Remains Of The Day".
This function is particularly good in that it handles certain exceptions.
Can you help me make it handle more? I'm interested in two tweaks, one easy,
one hard.
The easy tweak: I have certain acronyms that I'd always like to NOT be
converted into proper case -- I want them all upper. For instance, "ASCII",
"SCSI" and "IDE" shouldn't be rendered as "Ascii" "Scsi" and "Ide". The list
of exceptions is short and I'd be fine hardcoding them into the function.
The hard tweak: Certain "noise words" such as "is" "and" and "but" don't
belong in proper case. I don't want them capitalized at all UNLESS they're
the first word in the string.
Can any stringmeisters take a crack at this? Code appears below. If anyone
can help out with at least the first item, I'd be most appreciative.
-KF
Adjusting string handling function for exceptions?