Remove null character tcl

861 Views Asked by At

I have a variable which is getting a suffix of {} for some reason. i.e echo $file

<path to file> {}

This variable when consumed in other commands is now erroring out. How do I remove this empty list that is getting appended to my variable?

Something like regsub {} $file {} file . But that doesn't seem to work

1

There are 1 best solutions below

0
On

regsub works just fine. Try below:

% set a "file name {}"
file name {}
% regsub -all -- "{}" $a "" x
1
% puts $x
file name
%