Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

changing case to Title Case



$ foo="ONE TWO thRee FoUR"
$ print -r -- "${(C)foo}"

will output this:

One Two Three Four

but this:

$ foo="ONE TWO thRee FoUR's"
$ print -r -- "${(C)foo}"



will give this:

One Two Three Four'S

Note the S is capitalized

$ foo="ONE TWO thRee FoUR's.pdf"
$ print -r -- "${(C)foo}"     

will give this:

One Two Three Four'S.Pdf

Note that the P in PDF and the S after ' are capitalized.

Is there any way to avoid that?

TjL







Messages sorted by: Reverse Date, Date, Thread, Author