Quote Originally Posted by hadi123 View Post
I can do it with split and other methods but this is just a part of
a statement and doing this with pattern matching would be a LOT easier .
If you only have that simple pattern (series of characters of arbitrary length separated by a -) the solution proposed by ProgramThis is perfect. Using the split method you are actually using a regular expression and you will get all the matching groups in an array. I don't know why you believe it would be a lot easier with regular expressions, when you have to do what split does for you. I do use regular expressions quite often, so I know what I'm talking about.