I'm looking for a way to get strings from a string with specific tags, e.g. I have this string: "Hello <date> My <name> is <your name>" I need to return this: <date> <name> <your name>
"Hello <date> My <name> is <your name>"
<date>
<name>
<your name>
in an array or a list
only words starts and ends with <>.
Thanks a million! :-)
You can use the Regex pattern <.*?> to retrieve each word, ie
<.*?>
MatchCollection matches = Regex.Matches(input, "<.*?>");
You can then iterate over the collection to get the tags.
1.4m articles
1.4m replys
5 comments
57.0k users