Zuckerberg
Zuckerberg

Reputation: 205

Splitting Lists

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

Answers (2)

perreal
perreal

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

Herman Schoenfeld
Herman Schoenfeld

Reputation: 8734

var splits = yourString.Replace("{", string.Empty).Split('}');

Upvotes: 0

Related Questions