remove . at end of output

this is so that when writing out strings we don't get two . after one another
do not remove end of sentence character
reuse code to simplify implementation and change name for
understandability