Re: integer to string??
- To: mathgroup at smc.vnet.net
- Subject: [mg30953] Re: [mg30940] integer to string??
- From: BobHanlon at aol.com
- Date: Fri, 28 Sep 2001 03:55:01 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/9/27 2:20:09 AM, wzn at jongnederland.nl writes:
>Is it possible to append an integer to a string? For example in a for-loop
>i'm trying to create the strings: file1, file2, file3, etc. How can I do
>this by appending a counter (i) to the string filee.
>
If, as in your case, the desired result is strings
Table["file"<>ToString[k], {k, 5}]
{"file1", "file2", "file3",
"file4", "file5"}
If the desired result is symbols (variables) then
ToExpression[Table["file"<>ToString[k], {k, 5}]]
{file1, file2, file3, file4, file5}
Bob Hanlon
Chantilly, VA USA