added functionality in delSelected to delete a string in a string with the same characters