how to wrtite " " "
Simple question here,
I need to write a string through a loop that pulls out the user names from a database and this string will be used to populate a drop down menu.
The only problem is i cannot figure out how to write the " character in the string and without this the string cannot be used to populate the drop down menu.
The exact line concerned is
The desired output is
users = users + " " " + s + " ", "
Best regards and thanks for you time!
Is it giving you an error? That line seems fine to me. the only thing I can think of is quotation marks are special case characters and need something like \" to display them.
gave an output of "Kris", "Rory"
String name1 = "Kris";
String name2 = "Rory";
System.out.println(" \" "+name1+" \", \" "+name2+" \" ");
definitely need to escape the quotation marks you want displayed as already suggested
very much appreciated, worked a charm for the output, only now java doesnt like the input this output is being used for heh...
What a barrel of laughs.
Thankyou very much though for the input though people! Much appreciated! :)