Question: How to split indexed names ?

Hello everybody

I have a variable U of type set, made of index names name[expression sequence] 
One example is 
U := {A[1], A[2], B[2]}

I want to build the set of all the expression sequence  ; in the example above this is {1, 2}
op~(U) does the job ... although I do not really understand why

I also want to buid the set of all the name ;  ( {A, B} in the example)
Here I have written something that performs correctly  ... but it is very uggly
parse~(substring~(convert~(U, string), 1..1));  # works only for names with a single character !!!


I do not know how to isolate the names ?
Is it possible to write something smarter ?

Thanks in advance

Please Wait...