Reputation: 205
How do I split the below List
\{ 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\}
like below :
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
Upvotes: 1
Views: 86
Reputation: 98118
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}
Upvotes: 1
Reputation: 8734
var splits = yourString.Replace("{", string.Empty).Split('}');
Upvotes: 0