What is the best way to completely remove brackets in parts ofan expression

Hello

A simple example :

 data = {a, b, c, d};
 {15, With[{k = c}, Flatten[Position[data, k]]]} (*  output {15,{3}}  *)

To remove the brackets around 3 I found no other way than:

{15, With[{k = c}, Flatten[Position[data, k]]] /. {a_} -> a}  (* output {15,3} *)

Are there better ways to get this result? The most frequent use I have for this construction is to get iterators values for Sum or Product that are returned by various functions and of course they are always between brackets.

Thanks

If you are sure that c only occurs once, you can do it also with

data = {a, b, c, d};
Flatten[{15, With[{k = c}, Position[data, k]]}]

or with

data = {a, b, c, d};
{15, With[{k = c}, Position[data, k]][[1, 1]]}

In[1]:= (* in your example *)
{15, {3}} /. {a_, {b_}} → {a, b}

Out[1]= {15, 3}

In[2]:= (* more generally *)
range = {-2, 3};
Sum[x^2, {x, Sequence @@ range}]

Out[3]= 19

I like. Thanks