From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29288 invoked by alias); 12 Mar 2010 11:02:14 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 14925 Received: (qmail 3046 invoked from network); 12 Mar 2010 11:02:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED autolearn=ham version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 72.14.220.158 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=4bstfQPniR7723y7vDNcE2r7UZl9pmh+DcfWFUIWfQc=; b=ecVW0UroAdB5YivK50kO4MH1ukOJaFi73iiAhoBwisNrVDFdDsGaTv/0lwO5qEQBI0 w8+TiOWJ+sE/PLfhXS4RMIuwCphz5EM52y+hhB37YW8EqZkk8OABymI9yHVRVBX5lY1K tpPW1YN3EVP15oZQXqDk0k6lAjkcK+fGBhdF0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=sdV8rHYh4cpVa0y911R2T5dK9L2hKwecx+oBUDn5Wf0J5Op3DjQ1+7SPBehwmgdqy9 HyQJ8ZIkt4GuxfZg6FWnBAbe8XV8F2LLMRNxWmqtd2BKkk502sQLiwiAbKoS5DJoIJOF Cvo/SvYMWdDoiWYic4UEXowDaMvBTygnUPNGE= Message-ID: <4B9A1EFC.70507@gmail.com> Date: Fri, 12 Mar 2010 12:01:16 +0100 From: "Radoulov, Dimitre" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: zzapper CC: zsh-users@zsh.org Subject: Re: Title Case a Textified String References: <4B98F1D6.2020502@gmail.com> <237967ef1003110545m6e870074y3e43a11dbfdb3124@mail.gmail.com> <4B98F536.1010905@gmail.com> <4B98F6F7.1050002@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 11/03/2010 18.23, zzapper wrote: >>>>>> I want to convert a textified string to a Title Case Phrase >>>>>> >>>>>> eg >>>>>> fred-goat-dog.jpg to Fred Goat Dog >>>>>> >>>>>> >>>>> % print ${${(Cs:-:):-fred-goat-dog.jpg}%.*} >>>>> Fred Goat Dog >>>>> >>>> Okay, yours has the most smileys, so I guess you win this round. >>>> > Thanks both of you and for completeness (and for anyone googling into this > thread) > a solution to textify Fred Goat Dog to fred-goat-dog.jpg? > > % s='Fred Goat Dog' % print ${(L)s:gs/ /-/}.jpg fred-goat-dog.jpg Or: % print ${(L)s// /-}.jpg fred-goat-dog.jpg Regards Dimitre Regards Dimitre