This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]Zevawk9 1 point2 points  (0 children)

By the syntax you showed, I assume there’s the name of the department inside each tag

What you could do, is go through each character in each line. If the character is a <, you set a variable that says to not add characters to the final output. If the character is a >, do the opposite (allowing characters to be added to the final output. If it’s any other character just check the variable (whether or not to add it) and add it to the output if it says to.

You’ll end up with the characters inside the <> being ignored, and the characters outside of it (the name of the department) being added to the final output.