I am not finding that to be the case on my system. Using Windows 10.
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.24)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- string_codes(" a b c ",Codes_in),trim_line(Codes_in,Codes_out),string_codes(Line,Codes_out).
Codes_in = Codes_out, Codes_out = [32, 97, 32, 98, 32, 99, 32],
Line = " a b c ".
In the documentation if you click on at the end of the line it will take you to the source code.
What I did not expect based on just the name (trim_line) was that it does not remove space codes or characters, but space tokens, e.g.
Remove leading and trailing white space (b(_,_)) tokens from a line. so moving trim_line/2 is not something I would vote for.