i'm writing a small library that writes data out to a file. some of the data is strings, some of it is not - things like boolean (true/false) values...
when I have a string for data, I want to write the string to the file with quotes around it. so a string like "this is a string of data" would be written to the file with the quotes around it.
when i have other types of data, like a boolean, I want to write the boolean value to the file without quotes around it. so, false would be written as false - no quotes around it.
is there a way to automatically quote / not quote the value of a variable, depending on whether or not the variable holding the value is a string, when writing to a file?