I don't if the string end with line , I am giving the output as it is and trying to print the line as it is then next to the line I need to write valid or not valid . how ever if I try to type valid next to the line it will go to the next line no matter what I do :