如何将当前文本替换/转换为所需的表单?

In mySQL I have saved in a column seasons the row Autumn, Spring

However on the fronted I have to convert it to

'Autumn', 'Summer'

as below

$('.seed_season').selectpicker('val', ['Autumn', 'Summer']);

How can I achieve this?

Assuming you are getting the row value by using PHP / MYSQL than you can use like that:

$DBvalue = 'Autumn,Spring';
$exploded = explode(",", $DBvalue);

$newString = "'".implode("','", $exploded)."'";
echo $newString; // 'Autumn','Spring'

If you want to do that in the front-end you could use:

$(document).ready(function(){
  var formerStr ='Autumn, Summer';
  console.log('former string',formerStr);

  var res = formerStr.split(",");
  var newStr = '';
  res.forEach(function(entry) {
      newStr += "'"+entry+"',";
});
  newStr = newStr.slice(0, -1);
  console.log('final string',newStr);
});