Re: set character at string position




"Lisa Pearlson" <no@xxxxxxxx> wrote in message
news:43b597e1$0$16227$e4fe514c@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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
>
>

Have you considered buying a Tcl book?


.



Relevant Pages

  • set character at string position
    ... I looked at the string class, but I don't see how I can set/replace a ... character on a certain string position. ...
    (comp.lang.tcl)
  • Re: set character at string position
    ... I looked at the string class, but I don't see how I can set/replace a character on a certain string position. ...
    (comp.lang.tcl)
  • Re: Restricting the alphabet of a string
    ... implement a bit string class. ... as an extension to from trinary strings). ... raise ValueError("illegal character at index " + str(i) ...
    (comp.lang.python)
  • Re: String matches() method
    ... >>Sharp wrote: ... >>>I would like to use the matchesmethod of the String class to test the ... x is suppose to be a character. ... >Your suggested regular expression works, but I dont fully understand it. ...
    (comp.lang.java.programmer)
  • Re: removeing leading zeros in a text string (not a numeric field)
    ... Check out the TrimStart method of the string class. ... You pass it a character ... array of characters to remove - in this case, ...
    (microsoft.public.dotnet.languages.vb)