Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to capitalize last character of a string?
- X-seq: zsh-users 15498
- From: Eric De Mund <ead@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: How to capitalize last character of a string?
- Date: Tue, 26 Oct 2010 13:49:51 -0700
- Cc: nix@xxxxxxxxxxxxxxxx
- In-reply-to: <a695c10a88b7d75ca26ac49f3bd7c5c6.squirrel@xxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <a695c10a88b7d75ca26ac49f3bd7c5c6.squirrel@xxxxxxxxxxxxx>
- Reply-to: Eric De Mund <ead@xxxxxxxxx>
nix,
nix@xxxxxxxxxxxxxxxx writes:
] Subject: How to capitalize last character of a string?
] Hi, as the subject says, any guidance?
]
] TEST="word"
]
] print "${(C)TEST[1]}$TEST[2,-1]"
]
] Capitalizes the first character but somehow I could not come up with
] solution other way.
I'm not familiar with the syntax, but inferred the following. It seems
to work:
% TEST="word"
% print "$TEST[1,-2]${(C)TEST[-1]}"
worD
%
Regards,
Eric
--
Eric De Mund
ead@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author