Terminates a string with the given end string/character, but only if the value specified doesn't already exist and the string is not empty.