View previous topic :: View next topic |
Author |
Message |
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Tue Mar 28, 2023 10:57 am Post subject: Trim not working please comment |
|
|
program test_trim
character(len=30)::test
test = " nuts"
print *,'X',trim(test)
end
In the posted text there were a lot of spaces before "nuts" however, the forum software seems to have removed them, making my query somewhat unclear.
Please comment on why trim is not working. Thank you. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Mar 28, 2023 12:30 pm Post subject: |
|
|
TRIM only removes trailing spaces not leading spaces.
ADJUSTL can be used to remove leading spaces.
If you are using Plato, put the text cursor in the name (TRIM or ADJUSTL) and press F1. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Tue Mar 28, 2023 1:16 pm Post subject: |
|
|
Thank you, I will try what you say. Zach. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|