More often than not I get characters like “{\\ {” in my list which is the result of simple list which is concatenated or split by space .
Just looking for the reason behind these characters.
I know that the backspace followed by a special sign can be ignored from the equation but
what does \\ mean ?
A long time ago, everything in Tcl was stored internally as a string, including lists. Whitespace was chosen to separate list elements so they could be distinguished from each other later…
…but then some way to escape/quote whitespace characters was needed to be able to store these in the actual list elements.
{and}were used for this……and now you need to be able to escape
{and}, etc.In modern Tcl versions, lists are stored more efficiently internally, but from the script writers point of view it’s still stored that way for backwards compability and maybe for other reasons. So when you use a list as a string, you get this string representation of the list, with spaces, braces and backslashes.
The simple solution to your question is to never treat a list as a string, i.e. don’t send a list as an argument where the command expects a string. Then you’ll never see any special escape sequences unless you actually put them in an element.
And don’t treat strings as lists either: