source:
trunk/essentials/sys-devel/m4/examples/capitalize.m4@
3094
| Last change on this file since 3094 was 3090, checked in by , 19 years ago | |
|---|---|
| File size: 332 bytes | |
| Line | |
|---|---|
| 1 | dnl |
| 2 | dnl convert to upper- resp. lowercase |
| 3 | define(`upcase', `translit(`$*', `a-z', `A-Z')') |
| 4 | define(`downcase', `translit(`$*', `A-Z', `a-z')') |
| 5 | dnl |
| 6 | dnl capitalize a single word |
| 7 | define(`capitalize1', `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')') |
| 8 | define(`capitalize', `patsubst(`$1', `\w+', ``'capitalize1(`\0')')') |
Note:
See TracBrowser
for help on using the repository browser.
