So I have this response for a node.js program I'm using
'Content-Disposition': 'attachment; filename="tts.mp3"'
Instead of tts.mp3 I have a variable called textToConvert.
How can I add textToConvert.slice(0,10), and add .mp3 to the end of it to have that as the name of the mp3 file instead of tts.mp3?
Thanks in advance
'Content-Disposition': 'attachment; filename="' + textToConvert.slice(0, 10) + '.mp3"'
newResponse = response.replace(
/(filename=")(\w+\.mp3)(")/, '$1' + textToConvert.slice(0, 10) + '.mp3$3');