I am currently in the process of integrating with an old system that requires a value to be sent via a GET request as a tab delimited string. I have my data stored in an array, but I am facing difficulty when attempting to properly format it using the join()
method.
I have tried several approaches, none of which seem to work as intended;
var myArray = ["a", "b", "c"]
myArray.join(\t);
myArray.join(/\t/);
myArray.join('\t');
myArray.join('\\t');
myArray.join(' '); // tab character
Edit
Upon further investigation, it seems that the issue arises when attempting to URL encode the tab delimiter. Instead of converting the tab into %09
, it is simply being removed from the output.
Desired URL encoded var:
"?tags=a%09b%09c"
Actual output:
"?tags=abc"
If anyone has insights on how to resolve this issue, please share your knowledge!