如何避免 - 来自我在 tcl 中的数据?

How to avoid the - from my data in tcl?

我是tcl新手。当我在学习tcl中的一些基本命令时,我发现了这个我不知道如何解决的问题。

例如,我有 2 行输出数据

-

watermelon

实际上我想要的只是 "watermelon",我不想要“-

我试过如下使用 regsub 但未能避免“-”。

regsub -all -nocase "^{-\n}$" $fruits{} fruits

我也试过使用下面的正则表达式来跳过它,但仍然不起作用。

if {[regexp -nocase "^{-\n}$" $fruits]} {

    continue    
}

任何 suggestion/solution 可能有帮助?

% set fruits {-
watermelon}
-
watermelon
%
% regsub "^-\n" $fruits {} fruits
1
% set fruits
watermelon
%