Preppending suffix

by Manuel Souto Pico

JavaScript

var str = "Schweiz, Die";

// var name = str.match(/.+(?=,)/); // or
var name = str.match(/(.+),/)[1];
var article = str.match(/, (.+)/)[1];

var result = article + " " + name;
alert(result);