How to customize the CSV field separator?

If you are using the DataTables Extension to export the view into a CSV file you may need to customize the field separator (by default it is a comma). To do so you would need to adapt and paste the following code into your theme's functions.php file ( see how):