[GAP Forum] question about strings

Laurent Bartholdi laurent.bartholdi at gmail.com
Thu May 24 18:05:54 BST 2007


Dear Joao,
It seems to me that everything should be doable within GAP. Here's a
sample for a small file:

gap> s := InputTextFile("/home/laurent/.gaprc");
InputTextFile(/home/laurent/.gaprc)
gap> t := "";; while true do u := ReadLine(s); if IsString(u) then
Append(t,u); else break; fi; od;
gap> t;
"# .gaprc file by laurent ...\n"

You may easily modify the GAP code so that it strips the '\n' from the
string u before appending; you may consider inserting
'NormalizeWhitespace(u);' before the 'Append' command, for instance.

Best, Laurent
-- 
Laurent Bartholdi          \  laurent.bartholdi<at>gmail<dot>com
EPFL SB SMA IMB MAD         \    Téléphone: +41 21-6935458
Station 8                    \ Secrétaire: +41 21-6935471
CH-1015 Lausanne, Switzerland \      Fax: +41 21-6930339



More information about the Forum mailing list