0

I have multiple strings that contain names with [ ] inside of them. For example:

"Tim Drake [Van Dyke]" "Alex Scott [Hammer Field]" I need to pull the "Van Dyke" out. So far the only thing I have successfully done is to remove the [] characters.

$Test = "Time Drake [Van Dyke]"    
$Test -replace "[\[\]]",''

Any suggestions so far?

David
  • 891
  • 1
  • 8
  • 18
  • You should look into regular expressions – Alex Sarafian Jun 05 '19 at 21:49
  • If your input text is as structured as with your example then consider using `-split`. At every step, you need to identify you delimiter, split and then repeat the process on the proper fragment until it is good enough to e.g. just clean/strip the quotes. – Alex Sarafian Jun 05 '19 at 21:53

0 Answers0