Re: set character at string position
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 20:33:48 GMT
Lisa Pearlson wrote:
Hi,
I looked at the string class, but I don't see how I can set/replace a character on a certain string position.
In C I'd do something like:
char s[] = "Hello"; s[2] = 'x';
This would give "Hexlo"
How do I this in Tcl?
Lisa
set s "Hello" set s [string replace $s 2 2 x]
.
- References:
- set character at string position
- From: Lisa Pearlson
- set character at string position
- Prev by Date: set character at string position
- Next by Date: Underlining text on canvas
- Previous by thread: set character at string position
- Next by thread: Re: set character at string position
- Index(es):
Relevant Pages
|