问题
Is there a way to access a character in a string in fortran? If I wanted to store the first letter of a the string "taco" in a character variable how would I do that?
回答1:
Character variables and constants can be "substringed" using a syntax similar to an array section.
a_character_variable = "taco"(1:1)
A substring of a character variable is also a variable - it may appear on the left hand side of an assignment statement.
来源:https://stackoverflow.com/questions/36487824/fortran-procedure-attribute-conflict