Extract a single parameter from a CSV formatted string.
CSVtoStr( const data[], destination[], maxlen, item )
Extract single parameter from a CSV formatted string.
data | CSV formatted string |
destination | Buffer for extracted parameter |
maxlen | Max size of the destination buffer |
item | Which item to extract. The first item is 1. |
Assuming the input data is properly formatted as a CSV string (comma separated), this command finds the item by count and copies the string data into destination.
Number of characters copied into destination. If the item is not found, return 0.
new param{128}; new csvdata{} = "123, 1234, \"some string\", \"more data\""; CSVtoStr( csvdata, param, 128, 3 ); // param will now hold the text "some string" without quotes.