Re: dealing with special characters
- From: Harald Oehlmann <hoehlmann@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 9 Jul 2008 04:21:21 -0700 (PDT)
Hello Stuart,
If you have complicated strings in your source code and you do not
need any substitutions you may but the data into curly braces:
set MESS {15C3A33C 186005017"B1B@
\y@]@@]G@]M@]R@]V@]W@]Y@]]@]]@]e@]k@]s@]}@^F@^R@^X@^^@^k@^s@_B@_L@_U@__@_g@_q@_}@_?
@`F@`G@`J@`Q@`Q@`X@``@`k@`t@aA@aM@aW@ae@am@a~@bD@bO@bT@bY@bb@bc@b]@b
\@bc@bo@b{@cF@cU@c\@cb@cl@cv@]R@^s@`]@b^@Lr:BATTLOAD 0 13.42 36+0NN170W}
In contrast, if you use "" as string embracing characters, you may use
special characters like \ (escape), $ (variable substitution) or []
(command execution). One helpful escape for ugly strings is \u00xx
where xx is the hex code of the character.
On 8 Jul., 03:45, Stuart <bigdak...@xxxxxxx> wrote:
set MESS "15C3A33C 186005017\"B1B@
\y@]@@]G@]M@]R@]V@]W@]Y@]]@]]@]e@]k@]s@]}@^F@^R@^X@^^@^k@^s@_B@_L@_U@__@_g@_q@_}@_?
@`F@`G@`J@`Q@`Q@`X@``@`k@`t@aA@aM@aW@ae@am@a~@bD@bO@bT@bY@bb@bc@b]@b
\@bc@bo@b{@cF@cU@c\@cb@cl@cv@]R@^s@`]@b^@Lr:BATTLOAD 0 13.42 36+0NN
170W"
set MESS [lrange $MESS 1 end]
puts "MESS $MESS"
I suppose you want to return character 1 to the end. This might be
acheved using the string range command:
set MESS [string range $MESS 1 end]
Hope this helps,
Harald
.
- References:
- dealing with special characters
- From: Stuart
- dealing with special characters
- Prev by Date: ANN: Tcl Syntax Highlighting for DocBook / xslthl
- Next by Date: Re: nobody in today?
- Previous by thread: Re: dealing with special characters
- Next by thread: query regarding open braces
- Index(es):
Relevant Pages
|