new way of replacing bracket in string