1

如何拆分以下列表

\{ X.1.Agg-252 ethernet4/1 island ethernet10/1\} \{ X.1.Agg-252 ethernet4/2 island ethernet10/3\} \{ X.1.Agg-252 ethernet4/3 island ethernet10/5\} 

如下所示:

Element 1  - X.1.Agg-252 ethernet4/1 island ethernet10/1
Element 2 X.1.Agg-252 ethernet4/2 island ethernet10/3
Element 3 X.1.Agg-252 ethernet4/3 island ethernet10/5
4

2 回答 2

1
set a "\{ X.1.Agg-252 ethernet4/1 island ethernet10/1\} \{ X.1.Agg-252 ethernet4/2 island ethernet10/3\} \{ X.1.Agg-252 ethernet4/3 island ethernet10/5\}"
set y [split $a \{\}]
foreach w $y {puts $w}
于 2013-01-07T23:56:37.373 回答
0
var splits = yourString.Replace("{", string.Empty).Split('}');
于 2013-01-07T23:50:38.137 回答