how can I extract a part from string with “-” separated between the characters?
for example, I want to extract “123” from “123-4567-9012”
or extract “4567” from “123-4567-9012”
or even 9012 from the same string
how can I extract a part from string with – separated between the characters?
Share
Just split on the
-character and later you can access them. Use string.Split(char[])it will result in: