Silverfrost Forums

Welcome to our forums

Trim not working please comment

28 Mar 2023 9:57 #30117

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.

28 Mar 2023 11:30 #30120

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.

28 Mar 2023 12:16 #30121

Thank you, I will try what you say. Zach.

Please login to reply.