0

I am learning Fortran, and I have made this program in order to learn how to handle strings:

program use_strings
   character(100) :: theStr
   integer :: strLen
   theStr = "THIS IS A NICE LITTLE STRING!"
   strLen = len_trim(theStr)
   print *, "This is the len_trim of the string ", theStr, ": " ,strLen
end program use_strings

The output I expected was:

This is the len_trim of the string THIS IS A NICE LITTLE STRING!: 29

But instead I get this:

This is the len_trim of the string
THIS IS A NICE LITTLE STRING!
"TAB(s?)" : "TAB(s?)" 29

Question Not that the 'TAB(s?)' denotes that there were tabs printed in the terminal. So, my humble question: How do I get the printout on one line in the terminal?

Frysen
  • 7
  • 1

0 Answers0