Escape sequence in a string literal (Fortran)
问题 There is an example in C++ string str; str = "First\n" "Second\n" "Third;\n"; cout << str << endl; The output will be First Second Third; I wanna try to repeat it in Fortran and didn't find any info about escape-sequence in char string like in C++. 回答1: One way would be to use achar with the ASCII code for linefeed , that is 10 . The advantage of this method is, you can use other characters as necessary if you know the ASCII code. character(len=32):: str = "First" // achar(10) // "Second"