forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trim not working please comment

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Tue Mar 28, 2023 10:57 am    Post subject: Trim not working please comment Reply with quote

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
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7767
Location: Salford, UK

PostPosted: Tue Mar 28, 2023 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Tue Mar 28, 2023 1:16 pm    Post subject: Reply with quote

Thank you, I will try what you say. Zach.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group