I have a variable:
a = 2
and I have this string:
"//media.boohooman.com/i/boohooman/mzz11035_black_xl/mens-black-man-signature-embroidered-t-shirt?$product_page_main_magic_zoom$&fmt=webp"
I want edit this string so I can add variable, a, at a specific place in this string, after "mzz11035_black_xl", to make the whole string look like:
"//media.boohooman.com/i/boohooman/mzz11035_black_xl_2/mens-black-man-signature-embroidered-t-shirt?$product_page_main_magic_zoom$&fmt=webp"
What options do I have to achieve this goal. I know that there are some hard coded ways where I can count the characters before and after a specific place and do slicing, but I am looking for some more general method so that it would work even if the strings change a bit. eg.
"//media.boohooman.com/i/boohooman/mzz11035_blue_xl/mens-black-man-signature-embroidered-t-shirt?$product_page_main_magic_zoom$&fmt=webp"
or
"//media.boohooman.com/i/boohooman/mzz11035_blue_s/mens-black-man-signature-embroidered-t-shirt?$product_page_main_magic_zoom$&fmt=webp"
Thanks.