I know that
set line "This is a line."
puts whats between " inside the var line.
But
How do I do the same for
set line "This is a line "with quotations" inside the string."
I know that
set line "This is a line."
puts whats between " inside the var line.
But
How do I do the same for
set line "This is a line "with quotations" inside the string."
With most languages you can normally resolve with single quotes.
"This is a line 'with quotations' inside the string."
Hi.
This is one way:
#!/usr/bin/env tclsh
# @(#) s1 Demonstrate embedded quotes.
puts stdout ""
set version [ info tclversion ]
set message " Hello, world from tclsh ($version)"
puts stdout $message
puts stdout ""
set line "This is a line \"with quotations\" inside the string."
puts $line
producing:
$ ./s1
Hello, world from tclsh (8.4)
This is a line "with quotations" inside the string.
See Strings in Tcl
Tcl Crash Course - OpenOCD User's Guide
Best wishes ... cheers, drl