fortran adjustl
时间: 2024-05-01 16:16:37 浏览: 61
The function ADJUSTL in FORTRAN is used to left-adjust a character string. It removes any leading spaces from the string and then returns the modified string.
For example, consider the following code snippet:
```
character(10) str
str = ' hello'
str = ADJUSTL(str)
print *, str
```
In this case, the variable 'str' is initialized with a string that has three leading spaces. The ADJUSTL function is then used to left-adjust the string, which removes the spaces, and returns the modified string. The output of this code will be:
```
hello
```
Note that the original string ' hello' was 10 characters long, but the modified string 'hello ' is also 10 characters long. This is because the ADJUSTL function only removes leading spaces, and does not change the total length of the string.
阅读全文