2
$\begingroup$

I have this type of thing again and again in a long list: Row[{"F", ",", "G"}] and Row[{"B[Flat]", ",", "A"}] etc. I want these automatically replaced by "F","G" and "B[Flat]","A" etc.

$\endgroup$

2 Answers 2

3
$\begingroup$
{Row[{"F", ",", "G"}], Row[{"B[Flat]", ",", "A"}]} /. Row[x_] :> Select[x, # != "," &]
(* {{"F", "G"}, {"B[Flat]", "A"}} *)
$\endgroup$
2
  • $\begingroup$ Works, thanks a lot. $\endgroup$ Commented May 10, 2020 at 17:52
  • $\begingroup$ @QuasarSupernova You are welcome. Thanks for the accept. $\endgroup$ Commented May 11, 2020 at 1:07
2
$\begingroup$
Row[DeleteCases[First[Row[{"F", ",", "G"}]], ","]]
$\endgroup$
1
  • 1
    $\begingroup$ This gives FG. I want F,G $\endgroup$ Commented May 10, 2020 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.