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

Variable substitution Title Case



Hi

url='www.some.com/some_string_here'

want to extract and convert to' Some String Here'

anchortext=${url##*/}         # echo just the trailing directory
anchortext=${anchortext//_/ }  # substitute every _ with a space 
anchortext=${anchortext//-/ }  # substitute every - with a space 
anchortext=${(L)anchortext}   # lower case

been messing around with anchortext=$anchortext:gs/// but dont know if uses 
regexp memory??

but how can I do titlecase?


-- 
zzapper
http://zzapper.co.uk/ Technical Tips



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