Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Proper Case a line of text

Aug
2,832
149
Proper case capitalizes the first letter of every word in a text,
making it distinct from title case,
which only capitalizes major words.

This is different from the TPIPE documentation;

Code:
7 – Convert to Title Case
Converts all text to Title Case -- i.e., the first letter of every word is capitalized, and all other letters are forced to lower case.
This routine calculates a table of upper and lower case letters on TPIPE startup,
and this determination is based on the semantics of the language selected in Control Panel.

Here is an alias that I use;
Code:
R:\>which proper
proper is an alias : echo %$ > clip: & tpipe /clipboard /simple=7 & echo %@unquotes[%@clip[0]]

Proof;
Code:
R:\>proper THIS IS A TEST
This Is A Test

This can also be accomplished using the RECASE command from the TextUtilsplugin;

Code:
R:\>echo THIS IS A TEST > r:\test.txt

R:\>recase /i /l r:\test.txt |! recase /i /t r:\test.txt & type r:\test.txt


This Is A Test

RECASE does not accept input from clip: so I/O must be accomplished through a disk file.

Joe
 
Last edited:
After reading the fine print,
RECASE does accept input from clip:

Code:
R:\>echo THIS IS A TEST > clip:

R:\>recase /i /l clip: & recase /i /t clip: & type clip:
This Is A Test

Joe
 
As Charles mentioned, @CAPS works. I use the following function. This also gets rid of any errant caps by converting it to lowercase first.

ProperCase=%@Caps[%@Lower[%$]]
 
Back
Top