Function to print a string a certain amount of times