Erlang appending double quotes to a string -
When adding a double quote with a string, I have a problem that is append / "no"? Flags = "1223", Flags = "1", lists: level (io_lib: format ("{xmlelement, \" distributionstats \ ", [{\" messageid \ ", \ "~ S \"}, {\ "Status \", \ "~ s \"}], []} ", [id, flag])).
Your question is not very clear, but I have given the code given by you , And I think you are angry because the result string \ " is displayed with " instead of a single character. Or for a simple test: o) If you do not If you want to display the string, then use the io: format function to display the string in the console: {Xmlelement, "deliverystatus", [{"messageid", "1223"}, {"status", "1"}], [] The result for final, right To isolate the string, which is the return value of the IO: is displayed in the format and the console, this can add a carriage return: does not include any '\' if you use it to manipulate or manipulate it later If you want to record the value, then specify it in a variable:
1> ID = "1223" "1223" 2 & gt; Flag = "1" "1" 3> List: Flaton (io_lib: format ("{xmlelement, \" deliverystatus \ ", [{" messageid \ ", \" ~ s \ "}, {\" status \ ", \" ~ s \ "}], ["}, [Id, flag])." {Xmlelement, "DeliveryStatus \", [{\ "messageid \", \ "1223 \"}, {\ "status \", \ "1 \"} In fact, you have to keep in mind that whatever is available in the console is an image of the result of the final evaluation. In your case, this is a list, In which only printable characters are selected, so that Shell was chosen to display it as a string A. But it does not try to hide any information in order to tell your neighbors to tell that it is a string and \ "to call you before any special character, in this case the following "Is not part of the string and not a delimiter of this string but internally only" character "is stored. You can verify it by checking the length of the string:
5> gt; Length (lists: flatten (io_lib: format ("{xmlelement," deliverystatus \ ", [[\" Messageid \ ", \" ~ s \ "}, {\" status \ ", \ "~ S \"}], []} ", [id, flag])). 76 6 & gt;
6> 5 (7) The list: Flaton ("test \"). "Test \" "8">
4: IO: format (list: flatten (io_lib: format ("{ Xmlelement, \ "deliverystatus \", [{\ "messageid \", \ "~ s \"}, {\ "status \", \ "~ s \"}, []} ", [id, flag] OK)
8> IO: format (list : Flatten (io_lib: format ("{xmlelement, \" distributionstatus \ ", [{messageid \", \ "~ s \"}, {\ "status \", \ "~ s \"}], [ {} ", [" Message "," 1223 "}, {" status "," 1 "}], []," } OK 9> Edit: Io's return value: The format is always okay, print it only on the console. And gives returns right away. What I said is IO: With the format or length you can verify that the string
returned by the list: flatten (io_lib: format ("{xmlelement, \" deliverystatus \ "," [[",", "E-mail"),
My_string = list: flatten (io_lib: format ("{xmlelement, \" deliverystatus \ ", [\" Messageid \ ", \" ~ S \ "}, {\" status \ ", \" ~ s \ "}], []}", [i Minister, flag]),
Comments
Post a Comment