I have the following code:
$(this).children(\"a:eq(0)\").append(\'
try this. Just added .not(':last-child') which excludes the last element in your collection. So you don't have to remove it.
$(this).children("a:eq(0)").not(':last-child').append('' );