zsh-users
 help / color / mirror / code / Atom feed
* Variable substitution Title Case
@ 2011-02-23 11:39 zzapper
  2011-02-23 12:04 ` Mikael Magnusson
  0 siblings, 1 reply; 4+ messages in thread
From: zzapper @ 2011-02-23 11:39 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-23 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 11:39 Variable substitution Title Case zzapper
2011-02-23 12:04 ` Mikael Magnusson
2011-02-23 12:16   ` zzapper
2011-02-23 12:57   ` zzapper

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).