source: trunk/essentials/sys-devel/m4/examples/capitalize.m4@ 3094

Last change on this file since 3094 was 3090, checked in by bird, 19 years ago

m4 1.4.8

File size: 332 bytes
Line 
1dnl
2dnl convert to upper- resp. lowercase
3define(`upcase', `translit(`$*', `a-z', `A-Z')')
4define(`downcase', `translit(`$*', `A-Z', `a-z')')
5dnl
6dnl capitalize a single word
7define(`capitalize1', `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')')
8define(`capitalize', `patsubst(`$1', `\w+', ``'capitalize1(`\0')')')
Note: See TracBrowser for help on using the repository browser.