SteveMyres Posted April 13, 2013 Share Posted April 13, 2013 Is there a direct way to convert an array to a single string? I'm writing an array to a line in a file, and File.WriteDelim() works except that I want some other characters on the line, and WriteDelim() will terminate the line and not let me add the other characters. I also want some characters preceding the array on the line, but I can't File.Write() them, because that will terminate too. So if I can convert the array to a string, I can concatenate it with all the other stuff and do a single File.Write, which will terminate the line, but at that point that's fine. Link to comment Share on other sites More sharing options...
AzeoTech Posted April 13, 2013 Share Posted April 13, 2013 You mean, make {1,2,3} into "1, 2, 3" on one line? You'd have to do that with a loop. If you want them on separate lines, you might consider building up a multidimensional string array with your data, and then adding the ancillary stuff to that array, then using writeDelim(). Link to comment Share on other sites More sharing options...
SteveMyres Posted April 14, 2013 Author Share Posted April 14, 2013 OK. Was hoping there was some clever, non-looping way, but if I gotta do it in a loop, that's what I'll do! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.