how to change Symbol to other symbol?

I have

Input =a**b**c


I want to have output such as

{a,b,c}


So I want to change **->, but replace code does not work. How can I do it?

• Look at FullForm[Input] and FullForm[{a, b, c}] and note what change you really want. – Michael E2 Oct 24 '15 at 21:25
• You can't use Input as a variable name because it is a reserved function. Try this: input = a ** b ** c; Apply[List, input] – bill s Oct 24 '15 at 21:28

It is recommended to look at the FullForm of the expression when you are trying to use a pattern and rules.

FullForm[a ** b ** c]


Seeing this it becomes easy to then:

a ** b ** c /. NonCommutativeMultiply -> List
(* {a, b, c} *)


Typically, shorter is better. Bob Hanlon suggested using:

List @@ (a ** b ** c)
(* {a, b, c} *)


which is another solution.

• @Bob Hanlon - Nice. I added to answer. – Jack LaVigne Oct 25 '15 at 13:41